Spaces:
Runtime error
Runtime error
Update model.py
Browse files
model.py
CHANGED
@@ -45,7 +45,7 @@ def run(message: str,
|
|
45 |
system_prompt: str,
|
46 |
max_new_tokens: int = 1024,
|
47 |
temperature: float = 0.1,
|
48 |
-
top_p: float = 0.
|
49 |
top_k: int = 50) -> Iterator[str]:
|
50 |
prompt = get_prompt(message, chat_history, system_prompt)
|
51 |
inputs = tokenizer([prompt], return_tensors='pt', add_special_tokens=False).to(model.device)
|
@@ -63,6 +63,8 @@ def run(message: str,
|
|
63 |
top_k=top_k,
|
64 |
temperature=temperature,
|
65 |
num_beams=1,
|
|
|
|
|
66 |
)
|
67 |
t = Thread(target=model.generate, kwargs=generate_kwargs)
|
68 |
t.start()
|
|
|
45 |
system_prompt: str,
|
46 |
max_new_tokens: int = 1024,
|
47 |
temperature: float = 0.1,
|
48 |
+
top_p: float = 0.95,
|
49 |
top_k: int = 50) -> Iterator[str]:
|
50 |
prompt = get_prompt(message, chat_history, system_prompt)
|
51 |
inputs = tokenizer([prompt], return_tensors='pt', add_special_tokens=False).to(model.device)
|
|
|
63 |
top_k=top_k,
|
64 |
temperature=temperature,
|
65 |
num_beams=1,
|
66 |
+
eos_token_id=tokenizer.eos_token_id,
|
67 |
+
pad_token_id=tokenizer.pad_token_id,
|
68 |
)
|
69 |
t = Thread(target=model.generate, kwargs=generate_kwargs)
|
70 |
t.start()
|