prithivMLmods
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -14,4 +14,93 @@ tags:
|
|
14 |
- 7b
|
15 |
- LoRA
|
16 |
library_name: peft
|
17 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
- 7b
|
15 |
- LoRA
|
16 |
library_name: peft
|
17 |
+
---
|
18 |
+
|
19 |
+
<pre align="center">
|
20 |
+
.___ __ .__ .__ __
|
21 |
+
__| _/ ____ ____ ______ _/ |_ | |__ |__| ____ | | __
|
22 |
+
/ __ | _/ __ \ _/ __ \ \____ \ \ __\| | \ | | / \ | |/ /
|
23 |
+
/ /_/ | \ ___/ \ ___/ | |_> > | | | Y \| || | \| <
|
24 |
+
\____ | \___ > \___ >| __/ |__| |___| /|__||___| /|__|_ \
|
25 |
+
\/ \/ \/ |__| \/ \/ \/
|
26 |
+
</pre>
|
27 |
+
|
28 |
+
The **Deepthink-Reasoning-Adapter** is a fine-tuned version of the **Qwen2.5-7B-Instruct** base model, designed for text generation tasks that require deep reasoning, logical structuring, and problem-solving. This model leverages its optimized architecture to provide accurate and contextually relevant outputs for complex queries, making it ideal for applications in education, programming, and creative writing.
|
29 |
+
|
30 |
+
With its robust natural language processing capabilities, **Deepthink-Reasoning-Adapter** excels in generating step-by-step solutions, creative content, and logical analyses. Its architecture integrates advanced understanding of both structured and unstructured data, ensuring precise text generation aligned with user inputs.
|
31 |
+
|
32 |
+
- Significantly **more knowledge** and has greatly improved capabilities in **coding** and **mathematics**, thanks to our specialized expert models in these domains.
|
33 |
+
- Significant improvements in **instruction following**, **generating long texts** (over 8K tokens), **understanding structured data** (e.g, tables), and **generating structured outputs** especially JSON. **More resilient to the diversity of system prompts**, enhancing role-play implementation and condition-setting for chatbots.
|
34 |
+
- **Long-context Support** up to 128K tokens and can generate up to 8K tokens.
|
35 |
+
- **Multilingual support** for over 29 languages, including Chinese, English, French, Spanish, Portuguese, German, Italian, Russian, Japanese, Korean, Vietnamese, Thai, Arabic, and more.
|
36 |
+
|
37 |
+
# **Demo Start**
|
38 |
+
|
39 |
+
Here provides a code snippet with `apply_chat_template` to show you how to load the tokenizer and model and how to generate contents.
|
40 |
+
|
41 |
+
```python
|
42 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
43 |
+
|
44 |
+
model_name = "prithivMLmods/Deepthink-Reasoning-7B"
|
45 |
+
|
46 |
+
model = AutoModelForCausalLM.from_pretrained(
|
47 |
+
model_name,
|
48 |
+
torch_dtype="auto",
|
49 |
+
device_map="auto"
|
50 |
+
)
|
51 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
52 |
+
|
53 |
+
prompt = "Give me a short introduction to large language model."
|
54 |
+
messages = [
|
55 |
+
{"role": "system", "content": "You are Qwen, created by Alibaba Cloud. You are a helpful assistant."},
|
56 |
+
{"role": "user", "content": prompt}
|
57 |
+
]
|
58 |
+
text = tokenizer.apply_chat_template(
|
59 |
+
messages,
|
60 |
+
tokenize=False,
|
61 |
+
add_generation_prompt=True
|
62 |
+
)
|
63 |
+
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
64 |
+
|
65 |
+
generated_ids = model.generate(
|
66 |
+
**model_inputs,
|
67 |
+
max_new_tokens=512
|
68 |
+
)
|
69 |
+
generated_ids = [
|
70 |
+
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
71 |
+
]
|
72 |
+
|
73 |
+
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
74 |
+
```
|
75 |
+
# **Run with Ollama [Ollama Run]**
|
76 |
+
|
77 |
+
Ollama makes running machine learning models simple and efficient. Follow these steps to set up and run your GGUF models quickly.
|
78 |
+
|
79 |
+
## Quick Start: Step-by-Step Guide
|
80 |
+
|
81 |
+
| Step | Description | Command / Instructions |
|
82 |
+
|------|-------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
|
83 |
+
| 1 | **Install Ollama 🦙** | Download Ollama from [https://ollama.com/download](https://ollama.com/download) and install it on your system. |
|
84 |
+
| 2 | **Create Your Model File** | - Create a file named after your model, e.g., `metallama`. |
|
85 |
+
| | | - Add the following line to specify the base model: |
|
86 |
+
| | | ```bash |
|
87 |
+
| | | FROM Llama-3.2-1B.F16.gguf |
|
88 |
+
| | | ``` |
|
89 |
+
| | | - Ensure the base model file is in the same directory. |
|
90 |
+
| 3 | **Create and Patch the Model** | Run the following commands to create and verify your model: |
|
91 |
+
| | | ```bash |
|
92 |
+
| | | ollama create metallama -f ./metallama |
|
93 |
+
| | | ollama list |
|
94 |
+
| | | ``` |
|
95 |
+
| 4 | **Run the Model** | Use the following command to start your model: |
|
96 |
+
| | | ```bash |
|
97 |
+
| | | ollama run metallama |
|
98 |
+
| | | ``` |
|
99 |
+
| 5 | **Interact with the Model** | Once the model is running, interact with it: |
|
100 |
+
| | | ```plaintext |
|
101 |
+
| | | >>> Tell me about Space X. |
|
102 |
+
| | | Space X, the private aerospace company founded by Elon Musk, is revolutionizing space exploration... |
|
103 |
+
| | | ``` |
|
104 |
+
|
105 |
+
## Conclusion
|
106 |
+
With Ollama, running and interacting with models is seamless. Start experimenting today!
|