Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
11 |
response = requests.post(API_URL, headers=headers, json=payload2)
|
12 |
return response.json()["answer"]
|
13 |
-
def query2(
|
|
|
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 |
|