Spaces:
Runtime error
Runtime error
Commit
·
d222319
1
Parent(s):
e7e14eb
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,10 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
import requests
|
3 |
+
import os
|
4 |
|
5 |
+
def api_call(query):
|
6 |
+
# Make the API call and retrieve the response
|
7 |
+
response = requests.post(os.environ["ENDPOINT_URL"], json={"query": query})
|
8 |
+
return response.json()["result"]
|
9 |
+
|
10 |
+
gr.Interface(fn=api_call, inputs="text", outputs="markdown", allow_flagging="never").launch()
|