Instructions to use HyperX-Sen/Qwen-2.5-7B-Reasoning with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HyperX-Sen/Qwen-2.5-7B-Reasoning with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="HyperX-Sen/Qwen-2.5-7B-Reasoning") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("HyperX-Sen/Qwen-2.5-7B-Reasoning") model = AutoModelForCausalLM.from_pretrained("HyperX-Sen/Qwen-2.5-7B-Reasoning") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use HyperX-Sen/Qwen-2.5-7B-Reasoning with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HyperX-Sen/Qwen-2.5-7B-Reasoning" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HyperX-Sen/Qwen-2.5-7B-Reasoning", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/HyperX-Sen/Qwen-2.5-7B-Reasoning
- SGLang
How to use HyperX-Sen/Qwen-2.5-7B-Reasoning with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "HyperX-Sen/Qwen-2.5-7B-Reasoning" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HyperX-Sen/Qwen-2.5-7B-Reasoning", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "HyperX-Sen/Qwen-2.5-7B-Reasoning" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HyperX-Sen/Qwen-2.5-7B-Reasoning", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use HyperX-Sen/Qwen-2.5-7B-Reasoning with Docker Model Runner:
docker model run hf.co/HyperX-Sen/Qwen-2.5-7B-Reasoning
Qwen-2.5-7B-Reasoning (Fine-Tuned by HyperX-Sen)
🚀 Model Overview
This model is a fine-tuned version of Qwen/Qwen2.5-7B-Instruct, specifically optimized for advanced reasoning tasks. Fine-tuned on the OpenAI GSM8K dataset, it significantly enhances multi-step reasoning and problem-solving capabilities.
🔧 Fine-Tuning Details
- Base Model: Qwen/Qwen2.5-7B-Instruct
- Fine-tuned by: HyperX-Sen
- Dataset: GSM8K (Grade School Math 8K)
- Hardware: 2× Tesla T4 GPUs
- Objective: Improve complex reasoning and logical deduction
📈 Performance Improvements
Through fine-tuning on GSM8K, the model has improved in:
- Mathematical reasoning
- Step-by-step logical deduction
- Commonsense reasoning
- Word problem-solving
This makes it ideal for applications requiring high-level reasoning, such as AI tutoring, research assistance, and problem-solving AI agents.
🛠How to Use
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load the model and tokenizer
model_name = "HyperX-Sen/Qwen-2.5-7B-Reasoning"
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype="auto", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(model_name)
SYSTEM_PROMPT = """
Respond in the following format:
<reasoning>
...
</reasoning>
<answer>
...
</answer>
"""
# Define the conversation
messages = [
{"role": "system", "content": f"{SYSTEM_PROMPT}"},
{"role": "user", "content": "What are the potential impacts of artificial intelligence on employment?"}
]
# Format the chat input
input_text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
# Tokenize the formatted input
inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
# Generate the response
output = model.generate(**inputs, max_length=512, do_sample=True, temperature=0.7)
# Decode and display the response
response = tokenizer.decode(output[0], skip_special_tokens=True)
print(response)
🙌 Acknowledgments
A huge thanks to Qwen for providing the powerful Qwen2.5-7B-Instruct model, which served as the base for this fine-tuned version.
- Downloads last month
- 853