wop commited on
Commit
bb9d070
1 Parent(s): af9ec9a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -7,10 +7,11 @@ headers = {"Authorization": "Bearer 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"}
7
  API_URL2 = "https://api-inference.huggingface.co/models/valhalla/longformer-base-4096-finetuned-squadv1"
8
  headers2 = {"Authorization": "Bearer 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"}
9
  def query(payload):
10
- payload2 = "whats the context of teh question " + paylaod + " :"
11
  response = requests.post(API_URL, headers=headers, json=payload2)
12
  return response.json()["answer"]
13
- def query2(payload):
 
14
  response = requests.post(API_URL2, headers=headers2, json=payload)
15
  return response.json()["answer"]
16
 
 
7
  API_URL2 = "https://api-inference.huggingface.co/models/valhalla/longformer-base-4096-finetuned-squadv1"
8
  headers2 = {"Authorization": "Bearer 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"}
9
  def query(payload):
10
+ payload2 = "whats the context of the question " + paylaod + " :"
11
  response = requests.post(API_URL, headers=headers, json=payload2)
12
  return response.json()["answer"]
13
+ def query2(q, c):
14
+ paylaod = {"question": q, "context": c}
15
  response = requests.post(API_URL2, headers=headers2, json=payload)
16
  return response.json()["answer"]
17