Spaces:
Running
on
Zero
Running
on
Zero
aixsatoshi
commited on
Commit
•
1b238e0
1
Parent(s):
566d6bf
Update app.py
Browse files
app.py
CHANGED
@@ -42,6 +42,10 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
42 |
device_map="auto",
|
43 |
)
|
44 |
tokenizer = AutoTokenizer.from_pretrained(MODELS)
|
|
|
|
|
|
|
|
|
45 |
|
46 |
@spaces.GPU
|
47 |
def stream_chat(message: str, history: list, temperature: float, max_new_tokens: int, top_p: float, top_k: int, penalty: float):
|
|
|
42 |
device_map="auto",
|
43 |
)
|
44 |
tokenizer = AutoTokenizer.from_pretrained(MODELS)
|
45 |
+
terminators = [
|
46 |
+
tokenizer.eos_token_id,
|
47 |
+
tokenizer.convert_tokens_to_ids("<|eot_id|>")
|
48 |
+
]
|
49 |
|
50 |
@spaces.GPU
|
51 |
def stream_chat(message: str, history: list, temperature: float, max_new_tokens: int, top_p: float, top_k: int, penalty: float):
|