97 lines
3.8 KiB
Markdown
97 lines
3.8 KiB
Markdown
|
|
---
|
||
|
|
library_name: transformers
|
||
|
|
tags:
|
||
|
|
- text-generation-inference
|
||
|
|
- Math
|
||
|
|
- Code
|
||
|
|
- Thinker
|
||
|
|
license: apache-2.0
|
||
|
|
language:
|
||
|
|
- en
|
||
|
|
- zh
|
||
|
|
base_model:
|
||
|
|
- Qwen/Qwen2.5-1.5B-Instruct
|
||
|
|
pipeline_tag: text-generation
|
||
|
|
---
|
||
|
|
|
||
|
|

|
||
|
|
|
||
|
|
# **Gamma-Velorum-1.5B-Thinker**
|
||
|
|
|
||
|
|
> **Gamma-Velorum-1.5B-Thinker** is a **math and code reasoning model** fine-tuned from **Qwen2.5-1.5B**, crafted to tackle complex **mathematical** and **programming** problems using **chain-of-thought** methodology. It excels in **step-by-step explanations**, long-context understanding, and bilingual support — ideal for education, coding tutors, and logic-intensive applications.
|
||
|
|
|
||
|
|
## **Key Features**
|
||
|
|
|
||
|
|
1. **Math + Code Chain-of-Thought Reasoning**
|
||
|
|
Trained to provide detailed, structured steps for both **mathematical** and **coding** problems. Gamma-Velorum-1.5B-Thinker explains not just the what, but the *why*, ensuring clarity in logic and computation.
|
||
|
|
|
||
|
|
2. **Backed by Qwen2.5-1.5B**
|
||
|
|
Built on the latest Qwen2.5 architecture, bringing improved accuracy, reasoning capabilities, and enhanced tokenizer efficiency.
|
||
|
|
|
||
|
|
3. **Long-Context Problem Solving**
|
||
|
|
Capable of handling **long multi-turn questions**, nested logic, and extended code/math scenarios — ideal for competitive exams or coding challenges.
|
||
|
|
|
||
|
|
4. **Bilingual (English + Chinese)**
|
||
|
|
Seamlessly understands and reasons through prompts in both **English** and **Simplified Chinese**, making it versatile for global education platforms.
|
||
|
|
|
||
|
|
5. **Efficient and Lightweight**
|
||
|
|
With only 1.5B parameters, it strikes a balance between **performance and deployability**, suitable for web, edge, and mobile environments.
|
||
|
|
|
||
|
|
## **Quickstart with Transformers**
|
||
|
|
|
||
|
|
```python
|
||
|
|
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||
|
|
|
||
|
|
model_name = "prithivMLmods/Gamma-Velorum-1.5B-Thinker"
|
||
|
|
|
||
|
|
model = AutoModelForCausalLM.from_pretrained(
|
||
|
|
model_name,
|
||
|
|
torch_dtype="auto",
|
||
|
|
device_map="auto"
|
||
|
|
)
|
||
|
|
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
||
|
|
|
||
|
|
prompt = "Write a Python function to calculate factorial of a number."
|
||
|
|
messages = [
|
||
|
|
{"role": "system", "content": "You are a helpful tutor skilled in math and programming. Explain solutions step-by-step."},
|
||
|
|
{"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**
|
||
|
|
|
||
|
|
- **Math & Coding Tutors**: Solves word problems, algebra, logic puzzles, and programming challenges with clarity and precision.
|
||
|
|
- **Bilingual EdTech Apps**: Explains both math and code in English and Chinese for a broader learning reach.
|
||
|
|
- **STEM Reasoning Engines**: Powers scientific reasoning tools, code-assist bots, and step-by-step logic solvers.
|
||
|
|
- **Lightweight LLM Use Cases**: Browser-based, embedded systems, or mobile apps for learners and developers.
|
||
|
|
|
||
|
|
## **Limitations**
|
||
|
|
|
||
|
|
1. **Domain Focused**:
|
||
|
|
Optimized for **STEM and code** tasks — general conversation or abstract creative writing may not be as strong.
|
||
|
|
|
||
|
|
2. **Scale Limitations**:
|
||
|
|
As a 1.5B parameter model, it may not match larger models on highly complex logic or long-form generation.
|
||
|
|
|
||
|
|
3. **Bias Inheritance**:
|
||
|
|
Carries forward biases from its Qwen2.5 base model — important for sensitive contexts.
|
||
|
|
|
||
|
|
4. **Prompt Structuring Matters**:
|
||
|
|
Performs best with explicit, structured prompts for math/code. Ambiguous or casual phrasing may reduce accuracy.
|