Towhidul commited on
Commit
bc2a174
1 Parent(s): 589e750

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -4,8 +4,11 @@ import re
4
  import time
5
  import requests
6
 
 
 
 
7
  API_URL = "https://api-inference.huggingface.co/models/microsoft/prophetnet-large-uncased-squad-qg"
8
- headers = {"Authorization": "Bearer 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"}
9
 
10
  def query(payload):
11
  response = requests.post(API_URL, headers=headers, json=payload)
@@ -15,7 +18,7 @@ def query(payload):
15
  #-----------------------------------------------------------
16
 
17
  API_URL_evidence ="https://api-inference.huggingface.co/models/google/flan-t5-xxl"
18
- headers_evidence = {"Authorization": "Bearer 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"}
19
 
20
  def query_evidence(payload):
21
  response = requests.post(API_URL_evidence, headers=headers_evidence, json=payload)
 
4
  import time
5
  import requests
6
 
7
+
8
+ HF_SPACES_API_KEY = st.secrets["HF_token"]
9
+
10
  API_URL = "https://api-inference.huggingface.co/models/microsoft/prophetnet-large-uncased-squad-qg"
11
+ headers = {"Authorization": HF_SPACES_API_KEY}
12
 
13
  def query(payload):
14
  response = requests.post(API_URL, headers=headers, json=payload)
 
18
  #-----------------------------------------------------------
19
 
20
  API_URL_evidence ="https://api-inference.huggingface.co/models/google/flan-t5-xxl"
21
+ headers_evidence = {"Authorization": HF_SPACES_API_KEY}
22
 
23
  def query_evidence(payload):
24
  response = requests.post(API_URL_evidence, headers=headers_evidence, json=payload)