runMark commited on
Commit
d1083e7
1 Parent(s): 5733b12

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import requests
3
+ API_URL = "https://api-inference.huggingface.co/models/gpt2"
4
+ headers = {"Authorization": f"Bearer {API_TOKEN}"}
5
+ def query(payload):
6
+ data = json.dumps(payload)
7
+ response = requests.request("POST", API_URL, headers=headers, data=data)
8
+ return json.loads(response.content.decode("utf-8"))
9
+ data = query("Can you please let us know more details about your ")