Spaces:
Runtime error
Runtime error
Update model.py
Browse files
model.py
CHANGED
|
@@ -4,7 +4,7 @@ from typing import Iterator
|
|
| 4 |
import torch
|
| 5 |
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
|
| 6 |
|
| 7 |
-
model_id = 'TheBloke/CodeLlama-7B-
|
| 8 |
|
| 9 |
if torch.cuda.is_available():
|
| 10 |
config = AutoConfig.from_pretrained(model_id)
|
|
@@ -51,7 +51,7 @@ def get_input_token_length(message: str, chat_history: list[tuple[str, str]], sy
|
|
| 51 |
def run(message: str,
|
| 52 |
chat_history: list[tuple[str, str]],
|
| 53 |
system_prompt: str,
|
| 54 |
-
max_new_tokens: int =
|
| 55 |
temperature: float = 0.1,
|
| 56 |
top_p: float = 0.9,
|
| 57 |
top_k: int = 50) -> Iterator[str]:
|
|
|
|
| 4 |
import torch
|
| 5 |
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
|
| 6 |
|
| 7 |
+
model_id = 'TheBloke/CodeLlama-7B-Instruct-GPTQ'
|
| 8 |
|
| 9 |
if torch.cuda.is_available():
|
| 10 |
config = AutoConfig.from_pretrained(model_id)
|
|
|
|
| 51 |
def run(message: str,
|
| 52 |
chat_history: list[tuple[str, str]],
|
| 53 |
system_prompt: str,
|
| 54 |
+
max_new_tokens: int = 256,
|
| 55 |
temperature: float = 0.1,
|
| 56 |
top_p: float = 0.9,
|
| 57 |
top_k: int = 50) -> Iterator[str]:
|