AptlyDigital commited on
Commit
8b00e05
·
verified ·
1 Parent(s): c6830b5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -29
app.py CHANGED
@@ -1,29 +1,11 @@
1
- import gradio as gr
2
- from documents.loader import DocumentLoader
3
- from utils.rag_pipeline import RAGPipeline
4
-
5
- loader = DocumentLoader()
6
- rag = RAGPipeline()
7
-
8
- def process_query(question, history):
9
- return f"AI Tutor: I received your question: {question}"
10
-
11
- def upload_file(file):
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()