Spaces:
Runtime error
Runtime error
Greenniche
commited on
Commit
•
200fd6e
1
Parent(s):
03d523b
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,15 @@
|
|
1 |
-
import
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
10 |
|
11 |
|
12 |
import gradio as gr
|
|
|
1 |
+
import requests
|
2 |
+
|
3 |
+
API_URL = "https://api-inference.huggingface.co/models/spacy/zh_core_web_sm"
|
4 |
+
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
5 |
+
|
6 |
+
def query(payload):
|
7 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
8 |
+
return response.json()
|
9 |
+
|
10 |
+
output = query({
|
11 |
+
"inputs": "My name is Sarah Jessica Parker but you can call me Jessica",
|
12 |
+
})
|
13 |
|
14 |
|
15 |
import gradio as gr
|