Spaces:
Sleeping
Sleeping
Commit
·
b0e9c33
1
Parent(s):
1bc2625
Update main.py
Browse files
main.py
CHANGED
|
@@ -1,14 +1,11 @@
|
|
| 1 |
import requests
|
| 2 |
|
| 3 |
API_URL = "https://api-inference.huggingface.co/models/facebook/nllb-200-3.3B"
|
| 4 |
-
HF_TOKEN = "
|
| 5 |
|
| 6 |
headers = {"Authorization": f"Bearer {HF_TOKEN}"}
|
| 7 |
-
payload = {
|
| 8 |
-
"inputs": ">>afr_Latn<< Hello, how are you?",
|
| 9 |
-
"options": {"wait_for_model": True},
|
| 10 |
-
}
|
| 11 |
|
| 12 |
-
|
| 13 |
-
print(
|
| 14 |
-
print(
|
|
|
|
| 1 |
import requests
|
| 2 |
|
| 3 |
API_URL = "https://api-inference.huggingface.co/models/facebook/nllb-200-3.3B"
|
| 4 |
+
HF_TOKEN = ""
|
| 5 |
|
| 6 |
headers = {"Authorization": f"Bearer {HF_TOKEN}"}
|
| 7 |
+
payload = {"inputs": ">>zul_Latn<< Hello, how are you?"}
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
| 10 |
+
print(response.status_code)
|
| 11 |
+
print(response.text)
|