Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import requests
|
3 |
+
|
4 |
+
API_URL = "https://api-inference.huggingface.co/models/tscholak/cxmefzzi"
|
5 |
+
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
6 |
+
|
7 |
+
def query(payload):
|
8 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
9 |
+
return response.json()
|
10 |
+
|
11 |
+
iface = gr.Interface(fn=query, inputs="text", outputs="text")
|
12 |
+
iface.launch()
|
13 |
+
|
14 |
+
#output = query({
|
15 |
+
# "inputs": "The answer to the universe is",
|
16 |
+
#})
|