Spaces:
Sleeping
Sleeping
João Lima commited on
Commit ·
612aa4f
1
Parent(s): 7b96de5
changing gradio version
Browse files- app.py +7 -7
- requirements.txt +1 -5
app.py
CHANGED
|
@@ -28,19 +28,19 @@ with gr.Blocks(title="Tech Explainer RAG") as demo:
|
|
| 28 |
gr.Markdown("# Tech Explainer — RAG with Automatic Evaluation")
|
| 29 |
|
| 30 |
file = gr.File(label="Upload PDF", file_types=[".pdf"])
|
| 31 |
-
load_btn = gr.Button("Process PDF"
|
| 32 |
-
status = gr.Textbox(label="Status"
|
| 33 |
|
| 34 |
gr.Markdown("---")
|
| 35 |
|
| 36 |
question = gr.Textbox(label="Question", placeholder="Ask a question about the document...")
|
| 37 |
-
ask_btn = gr.Button("Ask"
|
| 38 |
|
| 39 |
-
answer = gr.Textbox(label="Answer", lines=5
|
| 40 |
-
sources = gr.Textbox(label="Sources", lines=2
|
| 41 |
-
evaluation = gr.Textbox(label="Evaluation", lines=3
|
| 42 |
|
| 43 |
load_btn.click(load_document, inputs=file, outputs=status)
|
| 44 |
ask_btn.click(ask, inputs=question, outputs=[answer, sources, evaluation])
|
| 45 |
|
| 46 |
-
demo.launch(
|
|
|
|
| 28 |
gr.Markdown("# Tech Explainer — RAG with Automatic Evaluation")
|
| 29 |
|
| 30 |
file = gr.File(label="Upload PDF", file_types=[".pdf"])
|
| 31 |
+
load_btn = gr.Button("Process PDF")
|
| 32 |
+
status = gr.Textbox(label="Status")
|
| 33 |
|
| 34 |
gr.Markdown("---")
|
| 35 |
|
| 36 |
question = gr.Textbox(label="Question", placeholder="Ask a question about the document...")
|
| 37 |
+
ask_btn = gr.Button("Ask")
|
| 38 |
|
| 39 |
+
answer = gr.Textbox(label="Answer", lines=5)
|
| 40 |
+
sources = gr.Textbox(label="Sources", lines=2)
|
| 41 |
+
evaluation = gr.Textbox(label="Evaluation", lines=3)
|
| 42 |
|
| 43 |
load_btn.click(load_document, inputs=file, outputs=status)
|
| 44 |
ask_btn.click(ask, inputs=question, outputs=[answer, sources, evaluation])
|
| 45 |
|
| 46 |
+
demo.launch()
|
requirements.txt
CHANGED
|
@@ -1,10 +1,6 @@
|
|
| 1 |
-
gradio==
|
| 2 |
transformers
|
| 3 |
sentence-transformers
|
| 4 |
-
langchain
|
| 5 |
-
langchain-core
|
| 6 |
-
langchain-community
|
| 7 |
-
langchain-text-splitters
|
| 8 |
faiss-cpu
|
| 9 |
pypdf
|
| 10 |
torch
|
|
|
|
| 1 |
+
gradio==3.50.2
|
| 2 |
transformers
|
| 3 |
sentence-transformers
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
faiss-cpu
|
| 5 |
pypdf
|
| 6 |
torch
|