File size: 4,746 Bytes
3d76017
 
 
 
cdb5936
 
2e066bc
3d76017
 
 
 
 
 
 
 
1ecb781
3d76017
 
 
 
 
 
 
 
 
cdb5936
af03c6f
d2ab0c6
f547685
af03c6f
 
f547685
 
 
af03c6f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
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
108
109
---
license: apache-2.0
datasets:
- smirki/UI_REASONING_v1.01
- SynthLabsAI/Big-Math-RL-Verified
- open-r1/OpenR1-Math-220k
- HuggingFaceH4/MATH-500
language:
- en
base_model:
- prithivMLmods/Viper-Coder-v1.1
pipeline_tag: text-generation
library_name: transformers
tags:
- text-generation-inference
- Non-Reasoning
- Raptor
- Coder
- X2
- Html
- Css
- React
- Python
- Java
- Qwen
- Math
---
![2.png](https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/KgTS_ikorbO6TlU6qoNpS.png)

# **Raptor-X2**

> [!warning]
> Non-Reasoning

> Raptor-X2 is based on the Qwen 2.5 14B modality architecture, designed to enhance the reasoning capabilities of 14B-parameter models. This model is optimized for advanced mathematical explanations, scientific reasoning, and general-purpose coding. It excels in contextual understanding, logical deduction, and multi-step problem-solving. Raptor-X2 has been fine-tuned using a long chain-of-thought reasoning model and specialized datasets to improve comprehension, structured responses, and conversational intelligence.

Key improvements include:  
1. **Enhanced Mathematical Reasoning**: Provides step-by-step explanations for complex mathematical problems, making it useful for students, researchers, and professionals.
2. **Advanced Scientific Understanding**: Excels in explaining scientific concepts across physics, chemistry, biology, and engineering.
3. **General-Purpose Coding**: Capable of generating, debugging, and optimizing code across multiple programming languages, supporting software development and automation.
4. **Long-Context Support**: Supports up to 128K tokens for input context and can generate up to 8K tokens in a single output, making it ideal for detailed responses.
5. **Multilingual Proficiency**: Supports over 29 languages, including English, Chinese, French, Spanish, Portuguese, German, Italian, Russian, Japanese, Korean, Vietnamese, Thai, Arabic, and more.

# **Quickstart with transformers**

Here is a code snippet with `apply_chat_template` to show you how to load the tokenizer and model and generate content:

```python
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "prithivMLmods/Raptor-X2"

model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype="auto",
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)

prompt = "Explain the fundamental theorem of calculus."
messages = [
    {"role": "system", "content": "You are a helpful assistant capable of answering a wide range of questions."},
    {"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)

generated_ids = model.generate(
    **model_inputs,
    max_new_tokens=512
)
generated_ids = [
    output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]

response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
```

# **Intended Use**  
1. **Mathematical Explanation**:  
   Designed for providing step-by-step solutions to mathematical problems, including algebra, calculus, and discrete mathematics.  
2. **Scientific Reasoning**:  
   Suitable for explaining scientific theories, conducting physics simulations, and solving chemistry equations.  
3. **Programming and Software Development**:  
   Capable of generating, analyzing, and optimizing code in multiple programming languages.  
4. **Educational Assistance**:  
   Helps students and researchers by providing explanations, summaries, and structured learning material.  
5. **Multilingual Applications**:  
   Supports global communication, translations, and multilingual content generation.  
6. **Long-Form Content Generation**:  
   Can generate extended responses, including research papers, documentation, and technical reports.  

# **Limitations**  
1. **Hardware Requirements**:  
   Requires high-memory GPUs or TPUs due to its large parameter size and long-context support.  
2. **Potential Bias in Responses**:  
   While designed to be neutral, outputs may still reflect biases present in training data.  
3. **Complexity in Some Scientific Domains**:  
   While proficient in general science, highly specialized fields may require verification.  
4. **Limited Real-World Awareness**:  
   Does not have access to real-time events beyond its training cutoff.  
5. **Error Propagation in Extended Outputs**:  
   Minor errors in early responses may affect overall coherence in long-form outputs.  
6. **Prompt Sensitivity**:  
   The effectiveness of responses may depend on how well the input prompt is structured.