Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -110,23 +110,48 @@ def summarize(lecture_text, mode, pdfs):
|
|
| 110 |
return result, pdf_path, docx_path
|
| 111 |
|
| 112 |
# -------------------------------
|
| 113 |
-
#
|
| 114 |
-
# -------------------------------
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
|
| 132 |
iface.launch()
|
|
|
|
| 110 |
return result, pdf_path, docx_path
|
| 111 |
|
| 112 |
# -------------------------------
|
| 113 |
+
# Full-Width Two-Column Interface
|
| 114 |
+
# -------------------------------
|
| 115 |
+
css = """
|
| 116 |
+
.gradio-container {
|
| 117 |
+
max-width: 100% !important;
|
| 118 |
+
}
|
| 119 |
+
"""
|
| 120 |
+
|
| 121 |
+
with gr.Blocks(css=css, theme="soft") as iface:
|
| 122 |
+
gr.Markdown("## 🧠 AI Study Assistant by Jericho Sonon")
|
| 123 |
+
gr.Markdown("Upload your lecture notes or PDFs to generate **Bullet Points**, **Flashcards**, or **MCQs** using OpenRouter GPT models.")
|
| 124 |
+
|
| 125 |
+
with gr.Row(equal_height=True):
|
| 126 |
+
with gr.Column(scale=1):
|
| 127 |
+
lecture_text = gr.Textbox(
|
| 128 |
+
lines=35,
|
| 129 |
+
label="Paste Lecture Text",
|
| 130 |
+
placeholder="Paste your lecture or notes here...",
|
| 131 |
+
interactive=True
|
| 132 |
+
)
|
| 133 |
+
mode = gr.Radio(
|
| 134 |
+
["Bullet Points", "Flashcards", "MCQs"],
|
| 135 |
+
label="Output Mode",
|
| 136 |
+
value="Bullet Points"
|
| 137 |
+
)
|
| 138 |
+
pdfs = gr.File(file_count="multiple", label="Upload PDFs (optional)")
|
| 139 |
+
generate_btn = gr.Button("Generate Study Notes", variant="primary")
|
| 140 |
+
|
| 141 |
+
with gr.Column(scale=1):
|
| 142 |
+
generated_notes = gr.Textbox(
|
| 143 |
+
label="Generated Notes",
|
| 144 |
+
lines=35,
|
| 145 |
+
interactive=True,
|
| 146 |
+
show_copy_button=True
|
| 147 |
+
)
|
| 148 |
+
pdf_file = gr.File(label="Download as PDF")
|
| 149 |
+
docx_file = gr.File(label="Download as DOCX")
|
| 150 |
+
|
| 151 |
+
generate_btn.click(
|
| 152 |
+
summarize,
|
| 153 |
+
inputs=[lecture_text, mode, pdfs],
|
| 154 |
+
outputs=[generated_notes, pdf_file, docx_file]
|
| 155 |
+
)
|
| 156 |
|
| 157 |
iface.launch()
|