Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,16 +9,16 @@ 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()
|
13 |
def query2(q, c):
|
14 |
payload = {"question": q, "context": c}
|
15 |
response = requests.post(API_URL2, headers=headers2, json=payload)
|
16 |
return response.json()['answer']
|
17 |
|
18 |
iface = gr.Interface(
|
19 |
-
fn=
|
20 |
-
inputs=[gr.Textbox("question")
|
21 |
-
outputs=gr.Textbox("
|
22 |
title="AI Interface",
|
23 |
description="Ask the AI model anything!",
|
24 |
)
|
|
|
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 |
payload = {"question": q, "context": c}
|
15 |
response = requests.post(API_URL2, headers=headers2, json=payload)
|
16 |
return response.json()['answer']
|
17 |
|
18 |
iface = gr.Interface(
|
19 |
+
fn=query,
|
20 |
+
inputs=[gr.Textbox("question")],
|
21 |
+
outputs=gr.Textbox("context"),
|
22 |
title="AI Interface",
|
23 |
description="Ask the AI model anything!",
|
24 |
)
|