Siddharth63 commited on
Commit
c46e264
·
verified ·
1 Parent(s): 44b29f0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +20 -3
README.md CHANGED
@@ -1,3 +1,20 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ ---
4
+ ```
5
+ !pip install --upgrade auto-round transformers
6
+
7
+ from transformers import AutoModelForCausalLM, AutoTokenizer
8
+ import torch
9
+ from auto_round import AutoRoundConfig ## must import for auto-round format
10
+
11
+ quantized_model_path = "Siddharth63/Qwen3-8B-Base-4bits-AutoRound-sym"
12
+ quantization_config = AutoRoundConfig(backend="auto")
13
+ model = AutoModelForCausalLM.from_pretrained(quantized_model_path, device_map="auto",
14
+ torch_dtype=torch.float16,
15
+ quantization_config=quantization_config)
16
+ tokenizer = AutoTokenizer.from_pretrained(quantized_model_path)
17
+ text = "Atherosclerosis"
18
+ inputs = tokenizer(text, return_tensors="pt").to(model.device)
19
+ print(tokenizer.decode(model.generate(**inputs, max_new_tokens=50)[0]))
20
+ ```