Improve language tag
#1
by
lbourdois
- opened
README.md
CHANGED
|
@@ -1,107 +1,118 @@
|
|
| 1 |
-
---
|
| 2 |
-
library_name: transformers
|
| 3 |
-
base_model:
|
| 4 |
-
- Qwen/Qwen2.5-3B-Instruct
|
| 5 |
-
license: apache-2.0
|
| 6 |
-
datasets:
|
| 7 |
-
- amphora/QwQ-LongCoT-130K
|
| 8 |
-
- amphora/QwQ-LongCoT-130K-2
|
| 9 |
-
- amphora/verfiable-25k
|
| 10 |
-
- amphora/m-math500
|
| 11 |
-
language:
|
| 12 |
-
-
|
| 13 |
-
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
-
|
| 17 |
-
-
|
| 18 |
-
-
|
| 19 |
-
-
|
| 20 |
-
-
|
| 21 |
-
-
|
| 22 |
-
-
|
| 23 |
-
-
|
| 24 |
-
-
|
| 25 |
-
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
)
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
The effectiveness of responses depends on well-structured prompts.
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
base_model:
|
| 4 |
+
- Qwen/Qwen2.5-3B-Instruct
|
| 5 |
+
license: apache-2.0
|
| 6 |
+
datasets:
|
| 7 |
+
- amphora/QwQ-LongCoT-130K
|
| 8 |
+
- amphora/QwQ-LongCoT-130K-2
|
| 9 |
+
- amphora/verfiable-25k
|
| 10 |
+
- amphora/m-math500
|
| 11 |
+
language:
|
| 12 |
+
- zho
|
| 13 |
+
- eng
|
| 14 |
+
- fra
|
| 15 |
+
- spa
|
| 16 |
+
- por
|
| 17 |
+
- deu
|
| 18 |
+
- ita
|
| 19 |
+
- rus
|
| 20 |
+
- jpn
|
| 21 |
+
- kor
|
| 22 |
+
- vie
|
| 23 |
+
- tha
|
| 24 |
+
- ara
|
| 25 |
+
pipeline_tag: text-generation
|
| 26 |
+
tags:
|
| 27 |
+
- Math
|
| 28 |
+
- Code
|
| 29 |
+
- Thinker
|
| 30 |
+
- Reasoning
|
| 31 |
+
- 3B
|
| 32 |
+
- QwQ
|
| 33 |
+
- Mini
|
| 34 |
+
- text-generation-inference
|
| 35 |
+
- SFT
|
| 36 |
+
- trl
|
| 37 |
+
---
|
| 38 |
+
|
| 39 |
+

|
| 40 |
+
|
| 41 |
+
# **PocketThinker-QwQ-3B-Instruct**
|
| 42 |
+
|
| 43 |
+
> PocketThinker-QwQ-3B-Instruct is based on the Qwen2.5-3B-Instruct architecture, designed as a lightweight and efficient reasoning assistant. It serves as the pocket-sized version of QwQ-LCoT-7B-Instruct, optimized for fast inference while maintaining strong problem-solving and computational capabilities. This model is fine-tuned for enhanced structured reasoning, minimal token wastage, and high-quality technical responses.
|
| 44 |
+
|
| 45 |
+
## **Key Improvements**
|
| 46 |
+
1. **Optimized for Coding**: Specializes in generating structured, efficient code with minimal redundancy for smooth execution.
|
| 47 |
+
2. **Compact yet Powerful**: Maintains strong problem-solving capabilities within a smaller 3B parameter architecture, ensuring accessibility on resource-limited devices.
|
| 48 |
+
3. **Advanced Reasoning Capabilities**: Excels in algorithmic problem-solving, mathematical reasoning, and structured technical explanations.
|
| 49 |
+
4. **Efficient Memory Utilization**: Reduces computational overhead while maintaining high-quality outputs.
|
| 50 |
+
5. **Focused Output Generation**: Avoids unnecessary token generation, ensuring concise and relevant responses.
|
| 51 |
+
|
| 52 |
+
## **Quickstart with transformers**
|
| 53 |
+
|
| 54 |
+
Here is a code snippet to load the tokenizer and model using `apply_chat_template` for structured input formatting:
|
| 55 |
+
|
| 56 |
+
```python
|
| 57 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 58 |
+
|
| 59 |
+
model_name = "prithivMLmods/PocketThinker-QwQ-3B-Instruct"
|
| 60 |
+
|
| 61 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 62 |
+
model_name,
|
| 63 |
+
torch_dtype="auto",
|
| 64 |
+
device_map="auto"
|
| 65 |
+
)
|
| 66 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 67 |
+
|
| 68 |
+
prompt = "Write a Python function to find the Fibonacci sequence."
|
| 69 |
+
messages = [
|
| 70 |
+
{"role": "system", "content": "You are an advanced coding assistant."},
|
| 71 |
+
{"role": "user", "content": prompt}
|
| 72 |
+
]
|
| 73 |
+
text = tokenizer.apply_chat_template(
|
| 74 |
+
messages,
|
| 75 |
+
tokenize=False,
|
| 76 |
+
add_generation_prompt=True
|
| 77 |
+
)
|
| 78 |
+
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
| 79 |
+
|
| 80 |
+
generated_ids = model.generate(
|
| 81 |
+
**model_inputs,
|
| 82 |
+
max_new_tokens=6090
|
| 83 |
+
)
|
| 84 |
+
generated_ids = [
|
| 85 |
+
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
| 86 |
+
]
|
| 87 |
+
|
| 88 |
+
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
| 89 |
+
print(response)
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
## **Intended Use**
|
| 93 |
+
1. **Code Generation & Optimization**:
|
| 94 |
+
Supports developers in writing, refining, and optimizing code across multiple programming languages.
|
| 95 |
+
2. **Algorithm & Mathematical Problem Solving**:
|
| 96 |
+
Delivers precise solutions and structured explanations for complex problems.
|
| 97 |
+
3. **Technical Documentation & Explanation**:
|
| 98 |
+
Assists in generating well-structured documentation for libraries, APIs, and coding concepts.
|
| 99 |
+
4. **Debugging Assistance**:
|
| 100 |
+
Helps identify and correct errors in code snippets.
|
| 101 |
+
5. **Educational Support**:
|
| 102 |
+
Simplifies programming topics for students and learners with clear explanations.
|
| 103 |
+
6. **Structured Data Processing**:
|
| 104 |
+
Generates structured outputs like JSON, XML, and tables for data science applications.
|
| 105 |
+
|
| 106 |
+
## **Limitations**
|
| 107 |
+
1. **Hardware Constraints**:
|
| 108 |
+
Although lighter than larger models, still requires a moderately powerful GPU or TPU for optimal performance.
|
| 109 |
+
2. **Potential Bias in Responses**:
|
| 110 |
+
Outputs may reflect biases present in training data.
|
| 111 |
+
3. **Limited Creativity**:
|
| 112 |
+
May generate variable results in non-technical, creative tasks.
|
| 113 |
+
4. **No Real-Time Awareness**:
|
| 114 |
+
Lacks access to real-world events beyond its training cutoff.
|
| 115 |
+
5. **Error Propagation in Long Responses**:
|
| 116 |
+
Minor mistakes in early outputs may affect overall coherence in lengthy responses.
|
| 117 |
+
6. **Prompt Sensitivity**:
|
| 118 |
The effectiveness of responses depends on well-structured prompts.
|