Spaces:
Running
on
Zero
Running
on
Zero
Update main.py
Browse files
main.py
CHANGED
@@ -57,10 +57,11 @@ def search(query: str, k: int) -> tuple[str]:
|
|
57 |
|
58 |
|
59 |
# Create an LLM pipeline that we can send queries to
|
60 |
-
|
|
|
61 |
streamer = transformers.TextIteratorStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
|
62 |
chatmodel = transformers.AutoModelForCausalLM.from_pretrained(
|
63 |
-
|
64 |
torch_dtype="auto",
|
65 |
device_map="auto"
|
66 |
)
|
|
|
57 |
|
58 |
|
59 |
# Create an LLM pipeline that we can send queries to
|
60 |
+
model_name = "Qwen/Qwen2-1.5B-Instruct"
|
61 |
+
tokenizer = transformers.AutoTokenizer.from_pretrained(model_name)
|
62 |
streamer = transformers.TextIteratorStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
|
63 |
chatmodel = transformers.AutoModelForCausalLM.from_pretrained(
|
64 |
+
model_name,
|
65 |
torch_dtype="auto",
|
66 |
device_map="auto"
|
67 |
)
|