Spaces:
Runtime error
Runtime error
harsh-manvar
commited on
Commit
•
d40f94b
1
Parent(s):
c6ba069
Update model.py
Browse files
model.py
CHANGED
@@ -3,8 +3,8 @@ from typing import Iterator
|
|
3 |
|
4 |
#import torch
|
5 |
from transformers.utils import logging
|
6 |
-
from ctransformers import AutoModelForCausalLM
|
7 |
-
from transformers import TextIteratorStreamer
|
8 |
|
9 |
logging.set_verbosity_info()
|
10 |
logger = logging.get_logger("transformers")
|
@@ -16,7 +16,8 @@ device = "cpu"
|
|
16 |
|
17 |
|
18 |
model = AutoModelForCausalLM.from_pretrained(model_id, model_type="llama", lib='avx2', hf=True)
|
19 |
-
tokenizer = AutoTokenizer.from_pretrained(
|
|
|
20 |
|
21 |
def get_prompt(message: str, chat_history: list[tuple[str, str]],
|
22 |
system_prompt: str) -> str:
|
|
|
3 |
|
4 |
#import torch
|
5 |
from transformers.utils import logging
|
6 |
+
from ctransformers import AutoModelForCausalLM
|
7 |
+
from transformers import TextIteratorStreamer, AutoTokenizer
|
8 |
|
9 |
logging.set_verbosity_info()
|
10 |
logger = logging.get_logger("transformers")
|
|
|
16 |
|
17 |
|
18 |
model = AutoModelForCausalLM.from_pretrained(model_id, model_type="llama", lib='avx2', hf=True)
|
19 |
+
tokenizer = AutoTokenizer.from_pretrained('Llama-2-7b-chat-hf')
|
20 |
+
#tokenizer = AutoTokenizer.from_pretrained('meta-llama/Llama-2-7b-chat-hf')
|
21 |
|
22 |
def get_prompt(message: str, chat_history: list[tuple[str, str]],
|
23 |
system_prompt: str) -> str:
|