-
Notifications
You must be signed in to change notification settings - Fork 680
Expand file tree
/
Copy pathgguf.py
More file actions
26 lines (22 loc) · 714 Bytes
/
Copy pathgguf.py
File metadata and controls
26 lines (22 loc) · 714 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""Load a GGUF model from Hugging Face.
Configuration and tokenizer assets are discovered automatically. Set `tok_model_id` only to
override that choice or when the source cannot be identified.
"""
from mistralrs import Runner, Which, ChatCompletionRequest
runner = Runner(
which=Which.GGUF(
quantized_model_id="unsloth/Qwen3-0.6B-GGUF",
quantized_filename="Qwen3-0.6B-Q4_K_M.gguf",
)
)
res = runner.send_chat_completion_request(
ChatCompletionRequest(
model="default",
messages=[
{"role": "user", "content": "Tell me a story about the Rust type system."}
],
max_tokens=256,
)
)
print(res.choices[0].message.content)
print(res.usage)