Ravshan commited on
Commit
1d1dd87
·
verified ·
1 Parent(s): c2bfd14

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -0
app.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import requests
3
+
4
+ API_URL = "https://api-inference.huggingface.co/models/blackhole33/sharq-model-uzb"
5
+ headers = {"Authorization": f"Bearer {hf_token}"}
6
+
7
+ def query(payload):
8
+ response = requests.post(API_URL, headers=headers, json=payload)
9
+ return response.json()
10
+
11
+ def req(comment):
12
+ res = query({
13
+ "inputs": comment,
14
+ "wait_for_model": True
15
+ })
16
+ return res
17
+
18
+
19
+
20
+ model = gr.Interface(fn=query, inputs="text", outputs="text")
21
+ model.launch(share=True)
22
+