Downloads · 30 days
0
Quinut/qwen_QL_v2
qwen_QL_v2 is a machine learning model from Quinut. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This is an advanced fine-tuned version of Qwen/Qwen2.5-7B-Instruct specifically trained to replicate the sophisticated writing style and analytical depth of professional quarterly investment letters using a novel 4-st…
Downloads · 30 days
0
Access
Public
Updated Sep 22, 2025
Repo size
6.5 GB
Likes
0
Public
Click a slice to open those files.
.safetensors7.3 GB · 71%
From the Hugging Face model README
This is an advanced fine-tuned version of Qwen/Qwen2.5-7B-Instruct specifically trained to replicate the sophisticated writing style and analytical depth of professional quarterly investment letters using a novel 4-stage curriculum learning approach.
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
# Load base model
base_model = AutoModelForCausalLM.from_pretrained(
"Qwen/Qwen2.5-7B-Instruct",
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True
)
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-7B-Instruct")
if tokenizer.pad_token is None:
tokenizer.pad_token = "<|endoftext|>"
# Load fine-tuned adapter
model = PeftModel.from_pretrained(base_model, "Quinut/qwen_QL_v2")
model.eval()
# Generate quarterly letter
system_prompt = "You are a senior portfolio manager with 25+ years of experience writing comprehensive quarterly investment letters for high-net-worth clients."
user_prompt = """Write a comprehensive quarterly market letter for Q4 2024 analyzing:
- Technology sector performance and AI investment trends
- Interest rate environment impact on bond and equity markets
- International market opportunities vs domestic positioning
- Portfolio allocation recommendations for 2025
Market Data:
• S&P 500: 5,881.63 (QTD: 2.41%, YTD: 25.02%)
• NASDAQ: 19,310.79 (QTD: 6.35%, YTD: 29.57%)
• 10-Year Treasury: 4.6%"""
# Format for Qwen
formatted_prompt = f"<|im_start|>system\n{system_prompt}<|im_end|>\n<|im_start|>user\n{user_prompt}<|im_end|>\n<|im_start|>assistant\n"
inputs = tokenizer(formatted_prompt, return_tensors="pt")
outputs = model.generate(
**inputs,
max_new_tokens=800,
temperature=0.7,
top_p=0.9,
repetition_penalty=1.05,
do_sample=True
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
generated_letter = response[len(formatted_prompt):].strip()
print(generated_letter)
| Metric | Previous Model | Qwen QL v2 |
|---|---|---|
| Training Approach | Single-stage | 4-stage curriculum |
| Final Loss | 1.23 | 1.74 |
| Style Learning | Basic | Advanced pattern extraction |
| Training Examples | ~100 | 230+ enhanced |
| Voice Consistency | Variable | Professional across conditions |
MIT License
Built using advanced curriculum learning techniques specifically designed for financial writing style replication.