Spaces:
Runtime error
Runtime error
wannaphong
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import torch
|
|
4 |
from transformers import AutoModelForCausalLM, AutoTokenizer, StoppingCriteria, StoppingCriteriaList, TextIteratorStreamer
|
5 |
from threading import Thread
|
6 |
|
7 |
-
model_path = '
|
8 |
|
9 |
# Loading the tokenizer and model from Hugging Face's model hub.
|
10 |
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
|
@@ -33,10 +33,7 @@ sft_end_token = "<|im_end|>"
|
|
33 |
ct_end_token = "<|endoftext|>"
|
34 |
|
35 |
system_prompt= \
|
36 |
-
'You are an AI assistant named
|
37 |
-
As an AI assistant, you can answer questions in English, Chinese, and Southeast Asian languages \
|
38 |
-
such as Burmese, Cebuano, Ilocano, Indonesian, Javanese, Khmer, Lao, Malay, Sundanese, Tagalog, Thai, Vietnamese, and Waray. \
|
39 |
-
Your responses should be friendly, unbiased, informative, detailed, and faithful.'
|
40 |
|
41 |
system_prompt = f"<|im_start|>{system_role}\n{system_prompt}<|im_end|>"
|
42 |
|
|
|
4 |
from transformers import AutoModelForCausalLM, AutoTokenizer, StoppingCriteria, StoppingCriteriaList, TextIteratorStreamer
|
5 |
from threading import Thread
|
6 |
|
7 |
+
model_path = 'wannaphong/tongyi-model-v1.1-1b-enth'
|
8 |
|
9 |
# Loading the tokenizer and model from Hugging Face's model hub.
|
10 |
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
|
|
|
33 |
ct_end_token = "<|endoftext|>"
|
34 |
|
35 |
system_prompt= \
|
36 |
+
'You are an AI assistant named TongYip (ทองหยิบ), created by PyThaiNLP. As an AI assistant, you can answer questions in Thai and English. Your responses should be friendly, unbiased, informative, detailed, and faithful.'
|
|
|
|
|
|
|
37 |
|
38 |
system_prompt = f"<|im_start|>{system_role}\n{system_prompt}<|im_end|>"
|
39 |
|