Downloads · 30 days
31
14% of all-time downloads
BikoRiko/Qwen2.5-1.5B-1.3M-Stretched
Qwen2.5-1.5B-1.3M-Stretched is a text generation model from BikoRiko. 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 is a custom, un-quantized, long-context variant of Qwen2.5-1.5B-Instruct. The model's native context window has been dynamically stretched from its original 32,768 tokens all the way out to 1300000 tokens (1.3m C…
Downloads · 30 days
31
14% of all-time downloads
All-time downloads
214
Public
Parameters
1.5B
3.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors3.1 GB · 99%
From the Hugging Face model README
This is a custom, un-quantized, long-context variant of Qwen2.5-1.5B-Instruct. The model's native context window has been dynamically stretched from its original 32,768 tokens all the way out to 1300000 tokens (1.3m Context) using advanced Dynamic-NTK RoPE scaling.
By scaling the rotary position embedding frequencies natively, the model preserves its low-context processing crispness while dramatically expanding its structural attention horizon—allowing it to ingest multiple entire codebases or full-length novels at once.
BFloat16 precision. Zero quantization artifacts, zero precision degradation.The original RoPE frequency base was stretched by implementing a dynamic scaling factor calculated perfectly to expand the 32k window to 1.3M without breaking the model's perplexity metrics:
max_position_embeddings: 2400000rope_scaling.type: dynamicrope_scaling.factor: 40.0While the model weights only occupy ~3 GB of memory, processing ultra-long sequences creates a massive KV Cache footprint that scales linearly.
Deployment Note: To test or run inference near the full 1.3M limit, an enterprise GPU cluster node (such as an NVIDIA A100 40GB/80GB or H100) is highly recommended. Ensure PyTorch SDPA is active to optimize memory layout overheads. Awnser me If you need more Ai models with a bigger context ask me becouse i have acces to b200 and more gpus with over 256gb ram so do not be afriad to ask me Thank you have a nice day.
You can run this model natively using the Hugging Face transformers library without needing to pass manual scaling parameters—the 1.3M configuration is fully baked into the config.json file.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "BikoRiko/Qwen2.5-1.5B-1.3M-Stretched"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="cuda",
attn_implementation="sdpa" # Essential for large KV-Cache stability
)
# Put your massive text file here (Up to 1.3 Million Tokens!)
prompt = "Your massive book or code content here..."
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens=50)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))