Views
No views yet
| Name | Quant method | Size |
|---|---|---|
| Qwen2.5-0.5b-Test-ft.Q2_K.gguf | Q2_K | 0.32GB |
| Qwen2.5-0.5b-Test-ft.IQ3_XS.gguf | IQ3_XS | 0.32GB |
| Qwen2.5-0.5b-Test-ft.IQ3_S.gguf | IQ3_S | 0.32GB |
| Qwen2.5-0.5b-Test-ft.Q3_K_S.gguf | Q3_K_S | 0.32GB |
| Qwen2.5-0.5b-Test-ft.IQ3_M.gguf | IQ3_M | 0.32GB |
| Qwen2.5-0.5b-Test-ft.Q3_K.gguf | Q3_K | 0.33GB |
| Qwen2.5-0.5b-Test-ft.Q3_K_M.gguf | Q3_K_M | 0.33GB |
| Qwen2.5-0.5b-Test-ft.Q3_K_L.gguf | Q3_K_L | 0.34GB |
| Qwen2.5-0.5b-Test-ft.IQ4_XS.gguf | IQ4_XS | 0.33GB |
| Qwen2.5-0.5b-Test-ft.Q4_0.gguf | Q4_0 | 0.33GB |
| Qwen2.5-0.5b-Test-ft.IQ4_NL.gguf | IQ4_NL | 0.33GB |
| Qwen2.5-0.5b-Test-ft.Q4_K_S.gguf | Q4_K_S | 0.36GB |
| Qwen2.5-0.5b-Test-ft.Q4_K.gguf | Q4_K | 0.37GB |
| Qwen2.5-0.5b-Test-ft.Q4_K_M.gguf | Q4_K_M | 0.37GB |
| Qwen2.5-0.5b-Test-ft.Q4_1.gguf | Q4_1 | 0.35GB |
| Qwen2.5-0.5b-Test-ft.Q5_0.gguf | Q5_0 | 0.37GB |
| Qwen2.5-0.5b-Test-ft.Q5_K_S.gguf | Q5_K_S | 0.38GB |
| Qwen2.5-0.5b-Test-ft.Q5_K.gguf | Q5_K | 0.39GB |
| Qwen2.5-0.5b-Test-ft.Q5_K_M.gguf | Q5_K_M | 0.39GB |
| Qwen2.5-0.5b-Test-ft.Q5_1.gguf | Q5_1 | 0.39GB |
| Qwen2.5-0.5b-Test-ft.Q6_K.gguf | Q6_K | 0.47GB |
| Qwen2.5-0.5b-Test-ft.Q8_0.gguf | Q8_0 | 0.49GB |
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "KingNish/Qwen2.5-0.5b-Test-ft"
4
5model = AutoModelForCausalLM.from_pretrained(
6 model_name,
7 torch_dtype="auto",
8 device_map="auto"
9)
10tokenizer = AutoTokenizer.from_pretrained(model_name)
11
12prompt = "Which is greater 9.9 or 9.11 ??"
13messages = [
14 {"role": "system", "content": "You are Qwen, created by Alibaba Cloud. You are a helpful assistant."},
15 {"role": "user", "content": prompt}
16]
17text = tokenizer.apply_chat_template(
18 messages,
19 tokenize=False,
20 add_generation_prompt=True
21)
22model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
23
24generated_ids = model.generate(
25 **model_inputs,
26 max_new_tokens=512
27)
28generated_ids = [
29 output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
30]
31
32response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
33
34print(response)