Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
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 |
|
@@ -6,9 +7,11 @@ 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")],
|
|
|
1 |
import gradio as gr
|
2 |
+
import os
|
3 |
|
4 |
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"
|
5 |
|
|
|
7 |
context = file.read()
|
8 |
|
9 |
question = "What should be documented in a care plan?"
|
10 |
+
HF_TOKEN = os.environ.get("HF_TOKEN")
|
11 |
gr.Interface.load(
|
12 |
"huggingface/deepset/roberta-base-squad2",
|
13 |
+
|
14 |
+
api_key=HF_TOKEN,
|
15 |
theme="default",
|
16 |
css=".footer{display:none !important}",
|
17 |
inputs=[gr.inputs.Textbox(lines=12, default=context, label="Context paragraph"), gr.inputs.Textbox(lines=3, default=question, label="Question")],
|