Update README.md
Browse files
README.md
CHANGED
@@ -163,27 +163,25 @@ datasets:
|
|
163 |
|
164 |
You can use it with a script
|
165 |
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
_ = model.generate(input_ids = inputs, streamer = text_streamer, max_new_tokens = max_new_tokens,
|
186 |
-
use_cache = True, temperature = temperature, min_p = min_p)
|
187 |
|
188 |
# Uploaded model
|
189 |
|
|
|
163 |
|
164 |
You can use it with a script
|
165 |
|
166 |
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
167 |
+
model_name="CineAI/Llama32-3B-CoT",
|
168 |
+
max_seq_length=max_length,
|
169 |
+
dtype=dtype,
|
170 |
+
load_in_4bit=load_in_4bit
|
171 |
+
)
|
172 |
+
|
173 |
+
FastLanguageModel.for_inference(model)
|
174 |
+
|
175 |
+
inputs = tokenizer.apply_chat_template(
|
176 |
+
message,
|
177 |
+
tokenize = True,
|
178 |
+
add_generation_prompt = True, # Must add for generation
|
179 |
+
return_tensors = "pt",
|
180 |
+
).to(device)
|
181 |
+
|
182 |
+
text_streamer = TextStreamer(tokenizer, skip_prompt = True)
|
183 |
+
_ = model.generate(input_ids = inputs, streamer = text_streamer, max_new_tokens = max_new_tokens,
|
184 |
+
use_cache = True, temperature = temperature, min_p = min_p)
|
|
|
|
|
185 |
|
186 |
# Uploaded model
|
187 |
|