Commit
•
8858016
1
Parent(s):
c01fd26
Create example-request.py
Browse files- example-request.py +9 -0
example-request.py
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import requests as r
|
2 |
+
|
3 |
+
ENDPOINT_URL = ""
|
4 |
+
HF_TOKEN = ""
|
5 |
+
|
6 |
+
payload = {"inputs": "What is the capital of France?"}
|
7 |
+
response = r.post(ENDPOINT_URL, headers={"Authorization": f"Bearer {HF_TOKEN}"}, json=payload)
|
8 |
+
|
9 |
+
print(response.json())
|