Astro 1 Nano π
Astro is an advanced 5B parameter artificial intelligence model developed by AstroAI, optimized for high-speed natural conversations, structural text tasks, and local deployment.
Key Features
- Efficient Size (5B): High performance with low VRAM footprint, perfect for local inference.
- Structured Chat Format: Ready out-of-the-box for system and user instruction following.
π οΈ Quantization (GGUF & Local Run)
Coming soon! We are exporting GGUF versions optimized for Ollama and LM Studio. Stay tuned!
π» Quick Start & Usage
You can easily run Astro-1-Nano using the Hugging Face transformers library. Ensure you have the chat_template correctly configured.
import torch
import json
from huggingface_hub import hf_hub_download
from transformers import AutoModelForCausalLM, AutoTokenizer, Qwen2Config
model_id = "zaballalkala/astro-1-nano"
config_file_path = hf_hub_download(repo_id=model_id, filename="config.json")
with open(config_file_path, "r") as f:
config_dict = json.load(f)
config_dict["model_type"] = "qwen2"
config_dict["architectures"] = ["Qwen2ForCausalLM"]
config = Qwen2Config.from_dict(config_dict)
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
config=config,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True
)
messages = [
{"role": "user", "content": "hi."}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
print("thinking... π§ \n")
generated_ids = model.generate(
**model_inputs,
max_new_tokens=512,
temperature=0.3,
do_sample=True
)
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)
- Downloads last month
- 1,514