Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,129 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
- zh
|
| 6 |
+
base_model:
|
| 7 |
+
- deepseek-ai/DeepSeek-R1-Distill-Qwen-14B
|
| 8 |
+
pipeline_tag: text-generation
|
| 9 |
+
library_name: transformers
|
| 10 |
+
tags:
|
| 11 |
+
- text-generation-inference
|
| 12 |
+
- math
|
| 13 |
+
- code
|
| 14 |
+
- reasoning
|
| 15 |
+
- R1
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+

|
| 19 |
+
|
| 20 |
+
# **Magellanic-Qwen-14B-R1**
|
| 21 |
+
|
| 22 |
+
**Magellanic-Qwen-14B-R1** is based on the **DeepSeek-R1-Distill-Qwen-14B** modality architecture, enhanced specifically for **mathematical reasoning** and **coding reasoning**. This model advances the capabilities of 14B-parameter architectures, excelling in logic-based problem solving, programming tasks, and context-rich dialogue generation. It is fine-tuned with extended chain-of-thought reasoning and domain-specific datasets for improved comprehension, structured generation, and precision in technical tasks.
|
| 23 |
+
|
| 24 |
+
---
|
| 25 |
+
|
| 26 |
+
## **Key Improvements**
|
| 27 |
+
1. **Mathematical Reasoning Enhancements**
|
| 28 |
+
Optimized with datasets targeting arithmetic, algebra, calculus, and formal logic, improving step-by-step solution generation and explanation accuracy.
|
| 29 |
+
|
| 30 |
+
2. **Coding Reasoning Enhancements**
|
| 31 |
+
Fine-tuned on diverse programming languages and reasoning-based coding problems (e.g., LeetCode, Codeforces, and real-world engineering tasks), significantly improving code generation, debugging, and documentation.
|
| 32 |
+
|
| 33 |
+
3. **Enhanced General Knowledge**
|
| 34 |
+
Broad knowledge base across various domains enables accurate and coherent responses for diverse topics.
|
| 35 |
+
|
| 36 |
+
4. **Improved Instruction Following**
|
| 37 |
+
Better handling of complex, multi-step instructions with structured and logically coherent outputs.
|
| 38 |
+
|
| 39 |
+
5. **Versatile Adaptability**
|
| 40 |
+
Resilient across open-ended and structured prompts, adapting well to different interaction styles and subject areas.
|
| 41 |
+
|
| 42 |
+
6. **Long-Context Support**
|
| 43 |
+
Supports up to **128K tokens** of input context and can generate up to **8K tokens** of output—ideal for in-depth technical and academic outputs.
|
| 44 |
+
|
| 45 |
+
---
|
| 46 |
+
|
| 47 |
+
## **Quickstart with transformers**
|
| 48 |
+
|
| 49 |
+
```python
|
| 50 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 51 |
+
|
| 52 |
+
model_name = "prithivMLmods/Magellanic-Qwen-14B-R1"
|
| 53 |
+
|
| 54 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 55 |
+
model_name,
|
| 56 |
+
torch_dtype="auto",
|
| 57 |
+
device_map="auto"
|
| 58 |
+
)
|
| 59 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 60 |
+
|
| 61 |
+
prompt = "Explain how quicksort works with an example in Python."
|
| 62 |
+
messages = [
|
| 63 |
+
{"role": "system", "content": "You are a helpful assistant skilled in coding and reasoning tasks."},
|
| 64 |
+
{"role": "user", "content": prompt}
|
| 65 |
+
]
|
| 66 |
+
text = tokenizer.apply_chat_template(
|
| 67 |
+
messages,
|
| 68 |
+
tokenize=False,
|
| 69 |
+
add_generation_prompt=True
|
| 70 |
+
)
|
| 71 |
+
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
| 72 |
+
|
| 73 |
+
generated_ids = model.generate(
|
| 74 |
+
**model_inputs,
|
| 75 |
+
max_new_tokens=512
|
| 76 |
+
)
|
| 77 |
+
generated_ids = [
|
| 78 |
+
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
| 79 |
+
]
|
| 80 |
+
|
| 81 |
+
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
---
|
| 85 |
+
|
| 86 |
+
## **Intended Use**
|
| 87 |
+
|
| 88 |
+
1. **Mathematics and Logic Tasks**
|
| 89 |
+
Solve and explain math problems, logical puzzles, and formula-based reasoning tasks step-by-step.
|
| 90 |
+
|
| 91 |
+
2. **Programming and Development**
|
| 92 |
+
Assist in generating code, debugging, documenting functions, and solving algorithmic problems across multiple languages.
|
| 93 |
+
|
| 94 |
+
3. **General-Purpose Reasoning**
|
| 95 |
+
Handle a wide variety of questions with accurate, contextual responses based on general knowledge and logic.
|
| 96 |
+
|
| 97 |
+
4. **Educational Assistance**
|
| 98 |
+
Help students and educators with clear, structured explanations in STEM and non-STEM subjects.
|
| 99 |
+
|
| 100 |
+
5. **Conversational AI & Chatbots**
|
| 101 |
+
Power intelligent assistants that require contextual awareness and technically sound responses.
|
| 102 |
+
|
| 103 |
+
6. **Multilingual Applications**
|
| 104 |
+
Translate, summarize, and generate multilingual content for global users.
|
| 105 |
+
|
| 106 |
+
7. **Long-Form Content Generation**
|
| 107 |
+
Generate coherent long articles, research summaries, and reports, especially with structured technical content.
|
| 108 |
+
|
| 109 |
+
---
|
| 110 |
+
|
| 111 |
+
## **Limitations**
|
| 112 |
+
|
| 113 |
+
1. **High Resource Usage**
|
| 114 |
+
Requires high-memory GPUs/TPUs for efficient inference, especially when utilizing 128K context.
|
| 115 |
+
|
| 116 |
+
2. **Bias and Hallucination Risk**
|
| 117 |
+
May reflect biases from pretraining data and occasionally hallucinate plausible-sounding but incorrect facts.
|
| 118 |
+
|
| 119 |
+
3. **Variability in Creative Tasks**
|
| 120 |
+
Less consistent in producing high-quality creative writing or highly subjective content.
|
| 121 |
+
|
| 122 |
+
4. **Training Cutoff Constraints**
|
| 123 |
+
No access to real-world events beyond the last training snapshot.
|
| 124 |
+
|
| 125 |
+
5. **Error Propagation in Long Outputs**
|
| 126 |
+
Minor early mistakes can compound in very long outputs.
|
| 127 |
+
|
| 128 |
+
6. **Prompt Sensitivity**
|
| 129 |
+
Performance may vary depending on prompt clarity and structure.
|