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/MoxoffSpA_-_Moxoff-Phi3Mini-ORPO-exl2 Moxoff-Phi3Mini-ORPO-6_5pip3 install huggingface-hub--revision parameter. For example, to download the 6.5 bpw branch:
Linux:huggingface-cli download MoxoffSpA_-_Moxoff-Phi3Mini-ORPO-exl2 --revision 6_5 --local-dir Moxoff-Phi3Mini-ORPO-6_5 --local-dir-use-symlinks Falsehuggingface-cli download MoxoffSpA_-_Moxoff-Phi3Mini-ORPO-exl2 --revision 6_5 --local-dir Moxoff-Phi3Mini-ORPO-6.5 --local-dir-use-symlinks False| hellaswag acc_norm | arc_challenge acc_norm | m_mmlu 5-shot acc | Average |
|---|---|---|---|
| 0.7621 | 0.5375 | 0.6824 | 0.6606 |
!pip install transformers torch sentencepiece1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3device = "cpu" # if you want to use the gpu make sure to have cuda toolkit installed and change this to "cuda"
4
5model = AutoModelForCausalLM.from_pretrained("MoxoffSpA/Moxoff-Phi3Mini-ORPO")
6tokenizer = AutoTokenizer.from_pretrained("MoxoffSpA/Moxoff-Phi3Mini-ORPO")
7
8question = """Quanto è alta la torre di Pisa?"""
9context = """
10La Torre di Pisa è un campanile del XII secolo, famoso per la sua inclinazione. Alta circa 56 metri.
11"""
12
13prompt = f"Domanda: {question}, contesto: {context}"
14
15messages = [
16 {"role": "user", "content": prompt}
17]
18
19encodeds = tokenizer.apply_chat_template(messages, return_tensors="pt")
20
21model_inputs = encodeds.to(device)
22model.to(device)
23
24generated_ids = model.generate(
25 model_inputs, # The input to the model
26 max_new_tokens=128, # Limiting the maximum number of new tokens generated
27 do_sample=True, # Enabling sampling to introduce randomness in the generation
28 temperature=0.1, # Setting temperature to control the randomness, lower values make it more deterministic
29 top_p=0.95, # Using nucleus sampling with top-p filtering for more coherent generation
30 eos_token_id=tokenizer.eos_token_id # Specifying the token that indicates the end of a sequence
31)
32
33decoded_output = tokenizer.decode(generated_ids[0], skip_special_tokens=True)
34trimmed_output = decoded_output.strip()
35print(trimmed_output)