awacke1 commited on
Commit
061ddf9
1 Parent(s): ee3012b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -7,11 +7,13 @@ with open('Context.txt', 'r') as file:
7
  context = file.read()
8
 
9
  question = "What should be documented in a care plan?"
10
- HF_TOKEN = os.environ.get("HF_TOKEN")
 
 
11
 
12
  gr.Interface.load(
13
  "huggingface/deepset/roberta-base-squad2",
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")],
 
7
  context = file.read()
8
 
9
  question = "What should be documented in a care plan?"
10
+
11
+ API_KEY = os.environ.get("HF_TOKEN")
12
+ headers = {"Authorization": f"Bearer {API_KEY}"}
13
 
14
  gr.Interface.load(
15
  "huggingface/deepset/roberta-base-squad2",
16
+ api_key=headers,
17
  theme="default",
18
  css=".footer{display:none !important}",
19
  inputs=[gr.inputs.Textbox(lines=12, default=context, label="Context paragraph"), gr.inputs.Textbox(lines=3, default=question, label="Question")],