File size: 467 Bytes
0209126 1187d29 09c8409 0209126 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
import gradio as gr
import requests
import os
API_TOKEN = os.environ['API_TOKEN']
API_URL = "https://api-inference.huggingface.co/models/tscholak/cxmefzzi"
headers = {"Authorization": f"Bearer {API_TOKEN}"}
def query(payload):
response = requests.post(API_URL, headers=headers, json=payload)
return response.json()
iface = gr.Interface(fn=query, inputs="text", outputs="text")
iface.launch()
#output = query({
# "inputs": "The answer to the universe is",
#}) |