Turbiling commited on
Commit
172c5fd
Β·
verified Β·
1 Parent(s): 6a76b66

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -24,7 +24,7 @@ book_data = {
24
  def clean_formatting(text):
25
  text = re.sub(r"\*\*(.*?)\*\*", r"\1", text)
26
  text = re.sub(r"\*(.*?)\*", r"\1", text)
27
- text = re.sub(r"[#β€’β—β†’βœ…πŸ”ΉπŸ”ΈπŸ“˜πŸ“–πŸ“‘πŸ“€πŸ“₯β¬‡οΈπŸŽ‰>"]", "", text)
28
  text = re.sub(r"\s{2,}", " ", text)
29
  return text.strip()
30
 
@@ -159,26 +159,26 @@ def export_book():
159
 
160
  # Gradio Interface
161
  with gr.Blocks() as demo:
162
- gr.Markdown("## πŸ“˜ AI Textbook Generator – Step-by-Step (APA Style)")
163
 
164
  with gr.Row():
165
  title = gr.Textbox(label="Subject Title")
166
  grade = gr.Textbox(label="Grade Level")
167
 
168
  slos = gr.Textbox(label="Paste SLOs (One per Line)", lines=10)
169
- generate_structure = gr.Button("🧠 Generate TOC + Preface")
170
  structure_output = gr.Textbox(label="Generated Preface and TOC", lines=15)
171
 
172
  generate_structure.click(fn=generate_book_intro, inputs=[title, grade, slos], outputs=structure_output)
173
 
174
- gr.Markdown("### πŸ“₯ Generate Chapters One by One")
175
  chapter_output = gr.Textbox(label="Generated Chapter Content", lines=25)
176
 
177
  with gr.Row():
178
  for i in range(1, 7):
179
  gr.Button(f"Generate Chapter {i}").click(fn=generate_chapter, inputs=gr.Number(value=i, visible=False), outputs=chapter_output)
180
 
181
- gr.Markdown("### πŸ’Ύ Download Complete Textbook")
182
  download_btn = gr.Button("Download MS Word Textbook")
183
  download_file = gr.File()
184
 
 
24
  def clean_formatting(text):
25
  text = re.sub(r"\*\*(.*?)\*\*", r"\1", text)
26
  text = re.sub(r"\*(.*?)\*", r"\1", text)
27
+ text = re.sub(r"[#β€’β—β†’βœ…πŸ”ΉπŸ”ΈπŸ“˜πŸ“–πŸ“‘πŸ“€πŸ“₯β¬‡οΈπŸŽ‰>]", "", text)
28
  text = re.sub(r"\s{2,}", " ", text)
29
  return text.strip()
30
 
 
159
 
160
  # Gradio Interface
161
  with gr.Blocks() as demo:
162
+ gr.Markdown("## \ud83d\udcd8 AI Textbook Generator \u2013 Step-by-Step (APA Style)")
163
 
164
  with gr.Row():
165
  title = gr.Textbox(label="Subject Title")
166
  grade = gr.Textbox(label="Grade Level")
167
 
168
  slos = gr.Textbox(label="Paste SLOs (One per Line)", lines=10)
169
+ generate_structure = gr.Button("\ud83e\udde0 Generate TOC + Preface")
170
  structure_output = gr.Textbox(label="Generated Preface and TOC", lines=15)
171
 
172
  generate_structure.click(fn=generate_book_intro, inputs=[title, grade, slos], outputs=structure_output)
173
 
174
+ gr.Markdown("### \ud83d\udcc5 Generate Chapters One by One")
175
  chapter_output = gr.Textbox(label="Generated Chapter Content", lines=25)
176
 
177
  with gr.Row():
178
  for i in range(1, 7):
179
  gr.Button(f"Generate Chapter {i}").click(fn=generate_chapter, inputs=gr.Number(value=i, visible=False), outputs=chapter_output)
180
 
181
+ gr.Markdown("### \ud83d\udcc2 Download Complete Textbook")
182
  download_btn = gr.Button("Download MS Word Textbook")
183
  download_file = gr.File()
184