Update README.md
Browse files
README.md
CHANGED
@@ -9,8 +9,34 @@ tags:
|
|
9 |
license: apache-2.0
|
10 |
language:
|
11 |
- en
|
|
|
|
|
12 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
|
|
|
|
|
|
|
|
|
|
14 |
# Uploaded model
|
15 |
|
16 |
- **Developed by:** alibidaran
|
@@ -19,4 +45,4 @@ language:
|
|
19 |
|
20 |
This llama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
|
21 |
|
22 |
-
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
|
|
|
9 |
license: apache-2.0
|
10 |
language:
|
11 |
- en
|
12 |
+
datasets:
|
13 |
+
- nvidia/OpenCodeReasoning
|
14 |
---
|
15 |
+
### Direct Uses:
|
16 |
+
```python
|
17 |
+
system_prompt="""
|
18 |
+
You are expert Python programmer. You task contians follwing instructions.
|
19 |
+
You should answer the user's questions about Python. Your thinking must be in the format <think>..</think>
|
20 |
+
The output format must contain only python codes with ```python syntax format.
|
21 |
+
You must use the the user input vairables in your code as code place holder.
|
22 |
+
"""
|
23 |
+
FastLanguageModel.for_inference(model)
|
24 |
+
messages = [
|
25 |
+
{'role':'system','content':system_prompt},
|
26 |
+
{"role": "user", "content":"How to write a Graph-based path finder algorithm?" },
|
27 |
+
]
|
28 |
+
inputs = tokenizer.apply_chat_template(
|
29 |
+
messages,
|
30 |
+
tokenize = True,
|
31 |
+
add_generation_prompt = True, # Must add for generation
|
32 |
+
return_tensors = "pt",
|
33 |
+
).to("cuda")
|
34 |
|
35 |
+
from transformers import TextStreamer
|
36 |
+
text_streamer = TextStreamer(tokenizer, skip_prompt = True)
|
37 |
+
_ = model.generate(input_ids = inputs, streamer = text_streamer, max_new_tokens =2048,
|
38 |
+
use_cache = True, temperature = 0.5, min_p = 0.9)
|
39 |
+
```
|
40 |
# Uploaded model
|
41 |
|
42 |
- **Developed by:** alibidaran
|
|
|
45 |
|
46 |
This llama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
|
47 |
|
48 |
+
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
|