hopeman66 commited on
Commit
9d40b8b
·
1 Parent(s): 420ed1c

Update app

Browse files
Files changed (1) hide show
  1. app +24 -0
app CHANGED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import requests
3
+
4
+
5
+
6
+
7
+ def query(payload):
8
+ response = requests.post(API_URL, headers=headers, json=payload)
9
+ return response.json()
10
+
11
+
12
+
13
+
14
+ def greet(name):
15
+ API_URL = "https://api-inference.huggingface.co/models/Duxiaoman-DI/XuanYuan-70B"
16
+ headers = {"Authorization": "Bearer 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"}
17
+
18
+ output = query({
19
+ "inputs": name,
20
+ })
21
+ return output
22
+
23
+ iface = gr.Interface(fn=greet, inputs="text", outputs="text")
24
+ iface.launch()