Kukedlc commited on
Commit
871e72c
1 Parent(s): 02d52fa

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +32 -5
README.md CHANGED
@@ -106,16 +106,43 @@ model-index:
106
  url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=Kukedlc/NeuralLLaMa-3-8b-ORPO-v0.3
107
  name: Open LLM Leaderboard
108
  ---
109
- ---
110
- library_name: transformers
111
- license: other
112
- ---
113
 
114
  # NeuralLLaMa-3-8b-ORPO-v0.3
115
 
116
  ![image/png](https://cdn-uploads.huggingface.co/production/uploads/64d71ab4089bc502ceb44d29/JyQNE7gAAyYTxKMO2PraO.png)
117
 
118
- [More Information Needed]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  # [Open LLM Leaderboard Evaluation Results](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)
120
  Detailed results can be found [here](https://huggingface.co/datasets/open-llm-leaderboard/details_Kukedlc__NeuralLLaMa-3-8b-ORPO-v0.3)
121
 
 
106
  url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=Kukedlc/NeuralLLaMa-3-8b-ORPO-v0.3
107
  name: Open LLM Leaderboard
108
  ---
109
+
 
 
 
110
 
111
  # NeuralLLaMa-3-8b-ORPO-v0.3
112
 
113
  ![image/png](https://cdn-uploads.huggingface.co/production/uploads/64d71ab4089bc502ceb44d29/JyQNE7gAAyYTxKMO2PraO.png)
114
 
115
+ ```python
116
+ !pip install -qU transformers accelerate bitsandbytes
117
+
118
+ from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer, BitsAndBytesConfig
119
+ import torch
120
+
121
+ bnb_config = BitsAndBytesConfig(
122
+ load_in_4bit=True,
123
+ bnb_4bit_use_double_quant=True,
124
+ bnb_4bit_quant_type="nf4",
125
+ bnb_4bit_compute_dtype=torch.bfloat16
126
+ )
127
+
128
+ MODEL_NAME = 'Kukedlc/NeuralLLaMa-3-8b-ORPO-v0.3'
129
+ tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
130
+ model = AutoModelForCausalLM.from_pretrained(MODEL_NAME, device_map='cuda:0', quantization_config=bnb_config)
131
+
132
+ prompt_system = "Sos un modelo de lenguaje de avanzada que habla español de manera fluida, clara y precisa.\
133
+ Te llamas Roberto el Robot y sos un aspirante a artista post moderno"
134
+ prompt = "Creame una obra de arte que represente tu imagen de como te ves vos roberto como un LLm de avanzada, con arte ascii, mezcla diagramas, ingenieria y dejate llevar"
135
+ chat = [
136
+ {"role": "system", "content": f"{prompt_system}"},
137
+ {"role": "user", "content": f"{prompt}"},
138
+ ]
139
+
140
+ chat = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
141
+ inputs = tokenizer(chat, return_tensors="pt").to('cuda')
142
+ streamer = TextStreamer(tokenizer)
143
+ _ = model.generate(**inputs, streamer=streamer, max_new_tokens=1024, do_sample=True, temperature=0.3, repetition_penalty=1.2, top_p=0.9,)
144
+ ```
145
+
146
  # [Open LLM Leaderboard Evaluation Results](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)
147
  Detailed results can be found [here](https://huggingface.co/datasets/open-llm-leaderboard/details_Kukedlc__NeuralLLaMa-3-8b-ORPO-v0.3)
148