Views
No views yet
| Branch | Bits | Description |
|---|---|---|
| 8_0 | 8.0 | Maximum quality that ExLlamaV2 can produce, near unquantized performance. |
| 6_5 | 6.5 | Very similar to 8.0, good tradeoff of size vs performance, recommended. |
| 5_0 | 5.0 | Slightly lower quality vs 6.5, but usable |
| 4_25 | 4.25 | GPTQ equivalent bits per weight, slightly higher quality. |
| 3_5 | 3.5 | Lower quality, only use if you have to. |
git clone --single-branch --branch 6_5 https://huggingface.co/KingNish_-_Reasoning-0.5b-exl2 Reasoning-0.5b-6_5pip3 install huggingface-hub--revision parameter. For example, to download the 6.5 bpw branch:
Linux:huggingface-cli download KingNish_-_Reasoning-0.5b-exl2 --revision 6_5 --local-dir Reasoning-0.5b-6_5 --local-dir-use-symlinks Falsehuggingface-cli download KingNish_-_Reasoning-0.5b-exl2 --revision 6_5 --local-dir Reasoning-0.5b-6.5 --local-dir-use-symlinks False1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3MAX_REASONING_TOKENS = 1024
4MAX_RESPONSE_TOKENS = 512
5
6model_name = "KingNish/Reasoning-0.5b"
7
8model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype="auto", device_map="auto")
9tokenizer = AutoTokenizer.from_pretrained(model_name)
10
11prompt = "Which is greater 9.9 or 9.11 ??"
12messages = [
13 {"role": "user", "content": prompt}
14]
15
16# Generate reasoning
17reasoning_template = tokenizer.apply_chat_template(messages, tokenize=False, add_reasoning_prompt=True)
18reasoning_inputs = tokenizer(reasoning_template, return_tensors="pt").to(model.device)
19reasoning_ids = model.generate(**reasoning_inputs, max_new_tokens=MAX_REASONING_TOKENS)
20reasoning_output = tokenizer.decode(reasoning_ids[0, reasoning_inputs.input_ids.shape[1]:], skip_special_tokens=True)
21
22# print("REASONING: " + reasoning_output)
23
24# Generate answer
25messages.append({"role": "reasoning", "content": reasoning_output})
26response_template = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
27response_inputs = tokenizer(response_template, return_tensors="pt").to(model.device)
28response_ids = model.generate(**response_inputs, max_new_tokens=MAX_RESPONSE_TOKENS)
29response_output = tokenizer.decode(response_ids[0, response_inputs.input_ids.shape[1]:], skip_special_tokens=True)
30
31print("ANSWER: " + response_output)