update the url
Browse files
app.py
CHANGED
|
@@ -4,13 +4,14 @@ from mtranslate import translate
|
|
| 4 |
import requests
|
| 5 |
|
| 6 |
HF_AUTH_TOKEN = os.environ.get("HF_AUTH_TOKEN")
|
| 7 |
-
indochat_api = 'https://cahya-indonesian-whisperer.hf.space/api/
|
| 8 |
indochat_api_auth_token = os.getenv("INDOCHAT_API_AUTH_TOKEN", "")
|
| 9 |
|
| 10 |
def get_answer(user_input, decoding_method, num_beams, top_k, top_p, temperature, repetition_penalty, penalty_alpha):
|
| 11 |
print(user_input, decoding_method, top_k, top_p, temperature, repetition_penalty, penalty_alpha)
|
| 12 |
headers = {'Authorization': 'Bearer ' + indochat_api_auth_token}
|
| 13 |
data = {
|
|
|
|
| 14 |
"text": user_input,
|
| 15 |
"min_length": len(user_input) + 50,
|
| 16 |
"max_length": 300,
|
|
|
|
| 4 |
import requests
|
| 5 |
|
| 6 |
HF_AUTH_TOKEN = os.environ.get("HF_AUTH_TOKEN")
|
| 7 |
+
indochat_api = 'https://cahya-indonesian-whisperer.hf.space/api/text-generator/v1'
|
| 8 |
indochat_api_auth_token = os.getenv("INDOCHAT_API_AUTH_TOKEN", "")
|
| 9 |
|
| 10 |
def get_answer(user_input, decoding_method, num_beams, top_k, top_p, temperature, repetition_penalty, penalty_alpha):
|
| 11 |
print(user_input, decoding_method, top_k, top_p, temperature, repetition_penalty, penalty_alpha)
|
| 12 |
headers = {'Authorization': 'Bearer ' + indochat_api_auth_token}
|
| 13 |
data = {
|
| 14 |
+
"model_name": "indochat-tiny",
|
| 15 |
"text": user_input,
|
| 16 |
"min_length": len(user_input) + 50,
|
| 17 |
"max_length": 300,
|