Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- book_generator.py +4 -1
book_generator.py
CHANGED
@@ -63,7 +63,7 @@ def gradio_interface():
|
|
63 |
gr.Markdown("## Book Generator")
|
64 |
gr.Markdown("This application was created by iLL-Ai AaronAllton and a team of Groq agents that write books.") # Updated note
|
65 |
book_title = gr.Textbox(label="Book Title")
|
66 |
-
book_outline = gr.Textbox(label="Book Outline (Structured format, e.g., 'Chapter 1: Synopsis 1; Chapter 2: Synopsis 2')")
|
67 |
generate_button = gr.Button("Generate Book")
|
68 |
output = gr.Textbox(label="Generated Book", interactive=False)
|
69 |
|
@@ -76,6 +76,9 @@ def gradio_interface():
|
|
76 |
if ':' in chapter:
|
77 |
title, synopsis = chapter.split(':', 1)
|
78 |
outline_dict[title.strip()] = synopsis.strip()
|
|
|
|
|
|
|
79 |
|
80 |
print(f"Processed Outline: {outline_dict}") # Debug statement
|
81 |
return write_book(book_agent, title, outline_dict)
|
|
|
63 |
gr.Markdown("## Book Generator")
|
64 |
gr.Markdown("This application was created by iLL-Ai AaronAllton and a team of Groq agents that write books.") # Updated note
|
65 |
book_title = gr.Textbox(label="Book Title")
|
66 |
+
book_outline = gr.Textbox(label="Book Outline (Structured format, e.g., 'Chapter 1: Synopsis 1; Chapter 2: Synopsis 2')") # Updated prompt
|
67 |
generate_button = gr.Button("Generate Book")
|
68 |
output = gr.Textbox(label="Generated Book", interactive=False)
|
69 |
|
|
|
76 |
if ':' in chapter:
|
77 |
title, synopsis = chapter.split(':', 1)
|
78 |
outline_dict[title.strip()] = synopsis.strip()
|
79 |
+
else:
|
80 |
+
# Handle cases where the input might not follow the expected format
|
81 |
+
outline_dict[chapter.strip()] = "No synopsis provided."
|
82 |
|
83 |
print(f"Processed Outline: {outline_dict}") # Debug statement
|
84 |
return write_book(book_agent, title, outline_dict)
|