Downloads · 30 days
8
5% of all-time downloads
eagle0504/qwen-distilled-scout-1.5b-gen2
qwen-distilled-scout-1.5b-gen2 is a text generation model from eagle0504. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
This model is a fine-tuned version of deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B, enhanced with chain-of-thought (CoT) reasoning on a hybrid dataset combining GSM8K-style reasoning and structured text-to-SQL generation.
Downloads · 30 days
8
5% of all-time downloads
All-time downloads
161
Public
Parameters
1.8B
3.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors3.6 GB · 100%
From the Hugging Face model README
This model is a fine-tuned version of deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B, enhanced with chain-of-thought (CoT) reasoning on a hybrid dataset combining GSM8K-style reasoning and structured text-to-SQL generation.
Fine-tuning was conducted using DeepSpeed on a multi-A100 GPU setup via RunPod for efficient training in memory-constrained environments. The training dataset includes complex logical SQL queries generated synthetically with corresponding natural language prompts and CoT explanations.
Inference notebook is publicly available here.
deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5BDataset Used:
gretelai/synthetic_text_to_sqleagle0504/openai-gsm8k-enhanced-using-together-ai-deepseek-train8k-test1k-v1eagle0504/augmented_codealpaca-20k-using-together-ai-deepseek-v1The dataset contains structured training examples of the form:
<question>...</question>
<think>...</think>
<response>...</response>
Each example is constructed to include:
sql_prompt)sql_explanation)sql)This format allows the model to internalize step-by-step logical reasoning for SQL generation.
Training was performed with the following configuration:
Batch Size: 2 (with gradient accumulation steps = 4)
Epochs: 15
Max Length: 1024 tokens
Optimizer: AdamW
Learning Rate: 5e-5 (with warmup + linear decay)
Precision: FP16
DeepSpeed Config:
Checkpoint Saving: Disabled to minimize disk usage
The model is evaluated with a custom token-level accuracy metric:
labels != -100)The model is designed for chain-of-thought text-to-SQL generation, useful in:
from transformers import StoppingCriteria, StoppingCriteriaList
import torch
class StopOnTokens(StoppingCriteria):
def __init__(self, stop_token_ids: list):
super().__init__()
self.stop_token_ids = stop_token_ids
def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor, **kwargs) -> bool:
# Check if the last token matches any of the stop tokens
return any(input_ids[0, -len(token):].tolist() == token for token in self.stop_token_ids)
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("eagle0504/qwen-distilled-scout-1.5b-gen2")
tokenizer = AutoTokenizer.from_pretrained("eagle0504/qwen-distilled-scout-1.5b-gen2")
# Example stop sequence
stop_sequence = "</response>"
stop_ids = tokenizer.encode(stop_sequence, add_special_tokens=False)
stopping_criteria = StoppingCriteriaList([StopOnTokens([stop_ids])])
# Run generation with stop sequence
inputs = tokenizer(
"<question>Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May?</question>",
return_tensors="pt"
)
outputs = model.generate(
**inputs,
max_new_tokens=230,
stopping_criteria=stopping_criteria
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
If you use this model in your work, please cite:
@misc{yin2025enhanceddeepseek,
title={Enhanced DeepSeek-R1-Distill-Qwen-1.5B Fine-tuned on GSM8K + CoT SQL},
author={Yiqiao Yin},
year={2025},
howpublished={\url{https://huggingface.co/eagle0504/enhanced-deepseek-r1-distill-qwen-1.5b-finetuned-on-gsm8k-codealpaca20k-text2sql}},
}
For questions or collaborations, reach out via LinkedIn or email: [email protected]