Spaces:
Runtime error
Runtime error
CaiRou-Huang
commited on
Commit
•
fa0c876
1
Parent(s):
93ace29
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import requests
|
2 |
+
API_URL = "https://api-inference.huggingface.co/models/gpt2"
|
3 |
+
headers = {"Authorization": f"Bearer {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}"}
|
4 |
+
def query(payload):
|
5 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
6 |
+
return response.json()
|
7 |
+
data = query("Can you please let us know more details about your ")
|