Spaces:
Sleeping
Sleeping
import gradio as gr | |
import requests | |
import os | |
hf_token = os.getenv('hf_token') | |
API_URL = "https://api-inference.huggingface.co/models/blackhole33/sharq-model-uzb" | |
headers = {"Authorization": f"Bearer {hf_token}"} | |
def query(payload): | |
response = requests.post(API_URL, headers=headers, json=payload) | |
return response.json() | |
def req(comment): | |
res = query({ | |
"inputs": comment, | |
"wait_for_model": True | |
}) | |
return res | |
model = gr.Interface(fn=query, inputs="text", outputs="text") | |
model.launch(share=True) | |