Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -42,12 +42,12 @@ data.reset_index(inplace=True)
|
|
42 |
model = sentence_transformers.SentenceTransformer(EMBEDDING_MODEL_NAME)
|
43 |
|
44 |
# Create an LLM pipeline that we can send queries to
|
45 |
-
tokenizer = transformers.AutoTokenizer.from_pretrained(LLM_MODEL_NAME)
|
46 |
streamer = transformers.TextIteratorStreamer(
|
47 |
-
tokenizer, skip_prompt=True, skip_special_tokens=True
|
48 |
)
|
49 |
chatmodel = transformers.AutoModelForCausalLM.from_pretrained(
|
50 |
-
LLM_MODEL_NAME,
|
51 |
)
|
52 |
|
53 |
# Create a FAISS index for fast similarity search
|
|
|
42 |
model = sentence_transformers.SentenceTransformer(EMBEDDING_MODEL_NAME)
|
43 |
|
44 |
# Create an LLM pipeline that we can send queries to
|
45 |
+
tokenizer = transformers.AutoTokenizer.from_pretrained(LLM_MODEL_NAME, torch_dtype=torch.float16)
|
46 |
streamer = transformers.TextIteratorStreamer(
|
47 |
+
tokenizer, skip_prompt=True, skip_special_tokens=True, torch_dtype=torch.float16
|
48 |
)
|
49 |
chatmodel = transformers.AutoModelForCausalLM.from_pretrained(
|
50 |
+
LLM_MODEL_NAME, device_map="auto", torch_dtype=torch.float16
|
51 |
)
|
52 |
|
53 |
# Create a FAISS index for fast similarity search
|