Update README.md
Browse files
README.md
CHANGED
@@ -149,27 +149,29 @@ datasets:
|
|
149 |
|
150 |
# How to use
|
151 |
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
|
|
|
|
173 |
|
174 |
# Uploaded model
|
175 |
|
|
|
149 |
|
150 |
# How to use
|
151 |
|
152 |
+
You can use it with a script
|
153 |
+
|
154 |
+
```python
|
155 |
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
156 |
+
model_name="CineAI/Llama32-3B-CoT",
|
157 |
+
max_seq_length=max_length,
|
158 |
+
dtype=dtype,
|
159 |
+
load_in_4bit=load_in_4bit
|
160 |
+
)
|
161 |
+
|
162 |
+
FastLanguageModel.for_inference(model)
|
163 |
+
|
164 |
+
inputs = tokenizer.apply_chat_template(
|
165 |
+
message,
|
166 |
+
tokenize = True,
|
167 |
+
add_generation_prompt = True, # Must add for generation
|
168 |
+
return_tensors = "pt",
|
169 |
+
).to(device)
|
170 |
+
|
171 |
+
text_streamer = TextStreamer(tokenizer, skip_prompt = True)
|
172 |
+
_ = model.generate(input_ids = inputs, streamer = text_streamer, max_new_tokens = max_new_tokens,
|
173 |
+
use_cache = True, temperature = temperature, min_p = min_p)
|
174 |
+
```
|
175 |
|
176 |
# Uploaded model
|
177 |
|