Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,29 +1,11 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
return f"Uploaded: {file.name}"
|
| 13 |
-
|
| 14 |
-
with gr.Blocks() as demo:
|
| 15 |
-
gr.Markdown("# AI Tutor for Exam Preparation")
|
| 16 |
-
with gr.Row():
|
| 17 |
-
with gr.Column():
|
| 18 |
-
file_input = gr.File(label="Upload PDF/Image")
|
| 19 |
-
upload_btn = gr.Button("Upload")
|
| 20 |
-
upload_output = gr.Textbox(label="Upload Status")
|
| 21 |
-
with gr.Column():
|
| 22 |
-
chatbot = gr.Chatbot()
|
| 23 |
-
msg = gr.Textbox(label="Your question")
|
| 24 |
-
send_btn = gr.Button("Send")
|
| 25 |
-
|
| 26 |
-
upload_btn.click(upload_file, inputs=file_input, outputs=upload_output)
|
| 27 |
-
send_btn.click(process_query, inputs=msg, outputs=chatbot)
|
| 28 |
-
|
| 29 |
-
demo.launch()
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
app = gr.Interface(
|
| 4 |
+
fn=lambda x: f"AI Tutor: I'll help you study '{x}'",
|
| 5 |
+
inputs="text",
|
| 6 |
+
outputs="text",
|
| 7 |
+
title="AI Exam Tutor",
|
| 8 |
+
description="Upload study materials and ask questions (RAG coming soon)"
|
| 9 |
+
)
|
| 10 |
+
|
| 11 |
+
app.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|