LouisMonawe commited on
Commit
b0e9c33
·
1 Parent(s): 1bc2625

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +5 -8
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 = "hf_your_token_here"
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
- res = requests.post(API_URL, headers=headers, json=payload)
13
- print(res.status_code)
14
- print(res.text)
 
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)