Spaces:
Runtime error
Runtime error
Create new file
Browse files
app.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
context = "This could be any large text corpus to use as subject matter to ask questions about. You can load it as well from text file to isolate it from code changes like in the next line"
|
4 |
+
|
5 |
+
with open('Context.txt', 'r') as file:
|
6 |
+
context = file.read()
|
7 |
+
|
8 |
+
question = "What should be documented in a care plan?"
|
9 |
+
|
10 |
+
gr.Interface.load(
|
11 |
+
"huggingface/deepset/roberta-base-squad2",
|
12 |
+
theme="default",
|
13 |
+
css=".footer{display:none !important}",
|
14 |
+
inputs=[gr.inputs.Textbox(lines=12, default=context, label="Context paragraph"), gr.inputs.Textbox(lines=3, default=question, label="Question")],
|
15 |
+
outputs=[gr.outputs.Textbox(label="Answer"), gr.outputs.Textbox(label="Score")],
|
16 |
+
title=None,
|
17 |
+
description="Provide your own paragraph and ask any question about the text. How well does the model answer?").launch()
|