Downloads · 30 days
23
18% of all-time downloads
Soumyajit-7/code-reasoning-deepseek-8b
code-reasoning-deepseek-8b is a text generation model from Soumyajit-7. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
This model is a fine-tuned version of unsloth/DeepSeek-R1-Distill-Llama-8B specialized for advanced code reasoning tasks. It has been trained on challenging programming problems from the nvidia/OpenCodeReasoning datas…
Downloads · 30 days
23
18% of all-time downloads
All-time downloads
130
Public
Parameters
8.2B
6 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors6 GB · 100%
How the weights are stored.
U87B · 85%
From the Hugging Face model README
This model is a fine-tuned version of unsloth/DeepSeek-R1-Distill-Llama-8B specialized for advanced code reasoning tasks. It has been trained on challenging programming problems from the nvidia/OpenCodeReasoning dataset, specifically focusing on problems with "VERY_HARD" difficulty levels (10 and 11).
The model was trained on a carefully filtered subset of the nvidia/OpenCodeReasoning dataset:
This model is designed for:
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("Soumyajit-7/code-reasoning-deepseek-8b")
model = AutoModelForCausalLM.from_pretrained(
"Soumyajit-7/code-reasoning-deepseek-8b",
torch_dtype=torch.float16,
device_map="auto"
)
# Define the prompt template
prompt_template = """Below is an instruction that describes a coding task, paired with an input that provides further context.
Write a response that appropriately completes the request.
Before answering, think carefully about the problem and create a step-by-step chain of thoughts to ensure a logical and accurate response.
### Instruction:
You are a coding expert with advanced knowledge in programming, algorithms, and problem-solving.
Please solve the following coding problem with detailed reasoning.
### Problem:
{problem}
### Response:
<think>"""
# Example usage
problem = """
Problem description.
Vipul is a hardworking super-hero who maintains the bracket ratio of all the strings in the world. Recently he indulged himself in saving the string population so much that he lost his ability for checking brackets (luckily, not permanently ).Being his super-hero friend help him in his time of hardship.
Input
The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.
The first line of each test case contains a single string S denoting the string to be checked.
Output
For each test case, output a single line printing "YES" or "NO" (without " " and in uppercase only) , denoting if the brackets in the given string is balanced or not .
Constraints
1 ≤ T ≤ 10
1 ≤ length of S ≤ 60
Example
Input:
3
((()))
(())()
()(()
Output:
YES
YES
NO
Explanation
Example is self-explanatory.
"""
prompt = prompt_template.format(problem=problem)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=1200,
temperature=0.7,
do_sample=True,
pad_token_id=tokenizer.eos_token_id
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response.split("### Response:")[1])
The model excels at:
The model expects prompts in the following format:
### Instruction:
You are a coding expert with advanced knowledge in programming, algorithms, and problem-solving.
Please solve the following coding problem with detailed reasoning.
### Problem:
[Your coding problem here]
### Response:
<think>
[The model will provide step-by-step reasoning here]
</think>
[Final solution/answer here]
This model has been specifically trained on the most challenging programming problems and shows improved performance on:
This model is designed for educational and research purposes. Users should:
Potential improvements:
If you use this model in your research, please cite:
@misc{code-reasoning-deepseek-8b,
title={DeepSeek R1 Code Reasoning 8B},
author={Soumyajit},
year={2025},
howpublished={\url{https://huggingface.co/Soumyajit-7/code-reasoning-deepseek-8b}},
}
Model trained and maintained by Soumyajit-7. For questions or issues, please open an issue in the repository.