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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: NickyNicky/dolphin-2_6-phi-2_oasst2_chatML_V2
|
| 3 |
+
inference: false
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
- es
|
| 7 |
+
- ru
|
| 8 |
+
- zh
|
| 9 |
+
- de
|
| 10 |
+
- fr
|
| 11 |
+
- th
|
| 12 |
+
- ca
|
| 13 |
+
- it
|
| 14 |
+
- ja
|
| 15 |
+
- pl
|
| 16 |
+
- eo
|
| 17 |
+
- eu
|
| 18 |
+
- vi
|
| 19 |
+
- fi
|
| 20 |
+
- hu
|
| 21 |
+
- ar
|
| 22 |
+
- nl
|
| 23 |
+
- da
|
| 24 |
+
- tr
|
| 25 |
+
- ko
|
| 26 |
+
- he
|
| 27 |
+
- id
|
| 28 |
+
- cs
|
| 29 |
+
- bn
|
| 30 |
+
- sv
|
| 31 |
+
model_creator: NickyNicky
|
| 32 |
+
model_name: dolphin-2_6-phi-2_oasst2_chatML_V2
|
| 33 |
+
pipeline_tag: text-generation
|
| 34 |
+
quantized_by: afrideva
|
| 35 |
+
tags:
|
| 36 |
+
- gguf
|
| 37 |
+
- ggml
|
| 38 |
+
- quantized
|
| 39 |
+
- q2_k
|
| 40 |
+
- q3_k_m
|
| 41 |
+
- q4_k_m
|
| 42 |
+
- q5_k_m
|
| 43 |
+
- q6_k
|
| 44 |
+
- q8_0
|
| 45 |
+
---
|
| 46 |
+
# NickyNicky/dolphin-2_6-phi-2_oasst2_chatML_V2-GGUF
|
| 47 |
+
|
| 48 |
+
Quantized GGUF model files for [dolphin-2_6-phi-2_oasst2_chatML_V2](https://huggingface.co/NickyNicky/dolphin-2_6-phi-2_oasst2_chatML_V2) from [NickyNicky](https://huggingface.co/NickyNicky)
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
| Name | Quant method | Size |
|
| 52 |
+
| ---- | ---- | ---- |
|
| 53 |
+
| [dolphin-2_6-phi-2_oasst2_chatml_v2.fp16.gguf](https://huggingface.co/afrideva/dolphin-2_6-phi-2_oasst2_chatML_V2-GGUF/resolve/main/dolphin-2_6-phi-2_oasst2_chatml_v2.fp16.gguf) | fp16 | 5.56 GB |
|
| 54 |
+
| [dolphin-2_6-phi-2_oasst2_chatml_v2.q2_k.gguf](https://huggingface.co/afrideva/dolphin-2_6-phi-2_oasst2_chatML_V2-GGUF/resolve/main/dolphin-2_6-phi-2_oasst2_chatml_v2.q2_k.gguf) | q2_k | 1.09 GB |
|
| 55 |
+
| [dolphin-2_6-phi-2_oasst2_chatml_v2.q3_k_m.gguf](https://huggingface.co/afrideva/dolphin-2_6-phi-2_oasst2_chatML_V2-GGUF/resolve/main/dolphin-2_6-phi-2_oasst2_chatml_v2.q3_k_m.gguf) | q3_k_m | 1.49 GB |
|
| 56 |
+
| [dolphin-2_6-phi-2_oasst2_chatml_v2.q4_k_m.gguf](https://huggingface.co/afrideva/dolphin-2_6-phi-2_oasst2_chatML_V2-GGUF/resolve/main/dolphin-2_6-phi-2_oasst2_chatml_v2.q4_k_m.gguf) | q4_k_m | 1.79 GB |
|
| 57 |
+
| [dolphin-2_6-phi-2_oasst2_chatml_v2.q5_k_m.gguf](https://huggingface.co/afrideva/dolphin-2_6-phi-2_oasst2_chatML_V2-GGUF/resolve/main/dolphin-2_6-phi-2_oasst2_chatml_v2.q5_k_m.gguf) | q5_k_m | 2.07 GB |
|
| 58 |
+
| [dolphin-2_6-phi-2_oasst2_chatml_v2.q6_k.gguf](https://huggingface.co/afrideva/dolphin-2_6-phi-2_oasst2_chatML_V2-GGUF/resolve/main/dolphin-2_6-phi-2_oasst2_chatml_v2.q6_k.gguf) | q6_k | 2.29 GB |
|
| 59 |
+
| [dolphin-2_6-phi-2_oasst2_chatml_v2.q8_0.gguf](https://huggingface.co/afrideva/dolphin-2_6-phi-2_oasst2_chatML_V2-GGUF/resolve/main/dolphin-2_6-phi-2_oasst2_chatml_v2.q8_0.gguf) | q8_0 | 2.96 GB |
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
## Original Model Card:
|
| 64 |
+
```
|
| 65 |
+
- model fine tune base: cognitivecomputations/dolphin-2_6-phi-2
|
| 66 |
+
- sft
|
| 67 |
+
- flash-attention 2
|
| 68 |
+
- loss: 0.85
|
| 69 |
+
- steps: 3000
|
| 70 |
+
- max_length: 2028
|
| 71 |
+
- neftune_noise_alpha: 5
|
| 72 |
+
```
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+

|
| 76 |
+
|
| 77 |
+
Install packages
|
| 78 |
+
```Python
|
| 79 |
+
!python -m pip install --upgrade pip
|
| 80 |
+
!pip install -q datasets trl peft bitsandbytes sentencepiece wandb
|
| 81 |
+
!pip install -q accelerate safetensors deepspeed
|
| 82 |
+
!pip install -q scipy
|
| 83 |
+
|
| 84 |
+
!export CUDA_HOME=/usr/local/cuda-11.8
|
| 85 |
+
# !pip install ninja
|
| 86 |
+
!pip install ninja packaging --upgrade -qqq
|
| 87 |
+
!MAX_JOBS=4 pip install flash-attn --no-build-isolation -qqq
|
| 88 |
+
!pip install git+"https://github.com/HazyResearch/flash-attention.git#subdirectory=csrc/rotary" -qqq
|
| 89 |
+
!python -m pip install optimum -qqq
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
Ioad model and generate text
|
| 93 |
+
```Python
|
| 94 |
+
|
| 95 |
+
from transformers import (
|
| 96 |
+
AutoModelForCausalLM,
|
| 97 |
+
AutoTokenizer,
|
| 98 |
+
BitsAndBytesConfig,
|
| 99 |
+
HfArgumentParser,
|
| 100 |
+
TrainingArguments,
|
| 101 |
+
pipeline,
|
| 102 |
+
logging,
|
| 103 |
+
GenerationConfig,
|
| 104 |
+
TextIteratorStreamer,
|
| 105 |
+
)
|
| 106 |
+
# from attention_sinks import AutoModelForCausalLM
|
| 107 |
+
|
| 108 |
+
import torch
|
| 109 |
+
|
| 110 |
+
model_id = "NickyNicky/dolphin-2_6-phi-2_oasst2_chatML_V2"
|
| 111 |
+
|
| 112 |
+
model = AutoModelForCausalLM.from_pretrained(model_id,
|
| 113 |
+
device_map="auto",
|
| 114 |
+
trust_remote_code=True,
|
| 115 |
+
torch_dtype=torch.bfloat16,
|
| 116 |
+
load_in_4bit=True,
|
| 117 |
+
low_cpu_mem_usage= True,
|
| 118 |
+
flash_attn=True,
|
| 119 |
+
flash_rotary=True,
|
| 120 |
+
fused_dense=True,
|
| 121 |
+
)
|
| 122 |
+
max_length=2028
|
| 123 |
+
print("max_length",max_length)
|
| 124 |
+
|
| 125 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id,
|
| 126 |
+
use_fast = True,
|
| 127 |
+
max_length=max_length,
|
| 128 |
+
trust_remote_code=True,)
|
| 129 |
+
|
| 130 |
+
prompt= """<|im_start|>system
|
| 131 |
+
You are a helpful AI assistant.<|im_end|>
|
| 132 |
+
<|im_start|>user
|
| 133 |
+
tengo hambre que me recomiendas<|im_end|>
|
| 134 |
+
<|im_start|>assistant"""
|
| 135 |
+
|
| 136 |
+
inputs = tokenizer.encode(prompt,
|
| 137 |
+
return_tensors="pt",
|
| 138 |
+
add_special_tokens=False).cuda()#.to("cuda") # False # True
|
| 139 |
+
|
| 140 |
+
generation_config = GenerationConfig(
|
| 141 |
+
max_new_tokens=700,
|
| 142 |
+
temperature=0.5,
|
| 143 |
+
top_p=0.9,
|
| 144 |
+
top_k=45,
|
| 145 |
+
repetition_penalty=1.15, #1.1, # 1.0 means no penalty, > 1.0 means penalty, 1.2 from CTRL paper
|
| 146 |
+
do_sample=True,
|
| 147 |
+
pad_token_id=tokenizer.eos_token_id,
|
| 148 |
+
eos_token_id=tokenizer.eos_token_id,
|
| 149 |
+
# bos_token_id=tokenizer.eos_token_id,
|
| 150 |
+
# use_cache=True,
|
| 151 |
+
# stopping_criteria= StoppingCriteriaList([stopping_criteria]),
|
| 152 |
+
)
|
| 153 |
+
|
| 154 |
+
outputs = model.generate(generation_config=generation_config,
|
| 155 |
+
input_ids=inputs,)
|
| 156 |
+
# tokenizer.decode(outputs[0], skip_special_tokens=False) #True
|
| 157 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=False))
|
| 158 |
+
|
| 159 |
+
'''OUTPUT:
|
| 160 |
+
<|im_start|>system
|
| 161 |
+
You are a helpful AI assistant.<|im_end|>
|
| 162 |
+
<|im_start|>user
|
| 163 |
+
tengo hambre que me recomiendas<|im_end|>
|
| 164 |
+
<|im_start|>assistant
|
| 165 |
+
Hay muchos tipos de alimentos que puedes probar si tienes hambre, pero aquí te muestro una lista ordenada por calor:
|
| 166 |
+
|
| 167 |
+
1- Frutas y verduras: Estas son buena opción para quitar hambre sin agotar tu cuerpo con grandes cantidades de carbohidratos. Algunas frutas y verduras que podrían ser suficientemente altas en calor durante el día incluyen tomates, plátanos, espinacas, papas, nueces, manzanas, limones, guisantes, cucumbers, zanahorias, etc.
|
| 168 |
+
2- Proteínas: Estas son importantes para mantener tu masa muscular y fuerzosa durante el día. Algunas proteínas que podrían ser útiles para quitar hambre durante el día incluyen carne, aceite de oliva, miel, yogur, leche fresca o sopa de gorditas, etc.
|
| 169 |
+
3- Carbohidratos: Estas son importantes para energizarte durante el día y mantenerte físico. Algunas frutas y verduras que podrían ser útiles para quitar hambre durante el día incluyen pan, tortillas, roti, arroz, pasta, rice, polenta, cereales, granola, etc.
|
| 170 |
+
4- Grains: Estas son importantes para mantenerte satiente durante el día y reducir la frecuencia de comidas rápida. Algunas gromas que podrían ser útiles para quitar hambre durante el día incluyen lentejas, farinas, tortilla, ensalada, etc.
|
| 171 |
+
5- Nuts y semolina: Estas son buenas opciones para quitar hambre durante el día sin agotar tu cuerpo con grandes cantidades de azúcar. Algunas frutas y verduras que podrían ser útiles para quitar hambre durante el día incluyen anacardios, almendras, macetas, bocaditos, panquesado, etc.
|
| 172 |
+
6- Papel picado: Esta es una opción deliciosa y económica que puedes preparar en caso de quitar hambre durante el día. Para hacer papel picado, primero cortezamos las frutas y verduras que deseas usarlas, y luego cortezamos las frutas y verduras que no deseas usarlas. A continuación, cortezamos las frutas y verduras que deseas usarlas más grandes y que estén más frescas, y luego cortezamos las frutas y verduras
|
| 173 |
+
'''
|
| 174 |
+
```
|