初始化项目,由ModelHub XC社区提供模型
Model: zenlm/zen-nano-0.6b Source: Original Platform
This commit is contained in:
64
README.md
Normal file
64
README.md
Normal file
@@ -0,0 +1,64 @@
|
||||
---
|
||||
language: en
|
||||
license: apache-2.0
|
||||
tags:
|
||||
- text-generation
|
||||
- zen
|
||||
- zenlm
|
||||
- hanzo
|
||||
- edge
|
||||
- mobile
|
||||
- lightweight
|
||||
pipeline_tag: text-generation
|
||||
library_name: transformers
|
||||
---
|
||||
|
||||
# Zen Nano 0.6b
|
||||
|
||||
Ultra-lightweight 0.6B language model optimized for edge and mobile deployment.
|
||||
|
||||
## Overview
|
||||
|
||||
Built on **Zen MoDE (Mixture of Distilled Experts)** architecture with 0.6B parameters and 32K context window.
|
||||
|
||||
Developed by [Hanzo AI](https://hanzo.ai) and the [Zoo Labs Foundation](https://zoo.ngo).
|
||||
|
||||
## Quick Start
|
||||
|
||||
```python
|
||||
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||
|
||||
model_id = "zenlm/zen-nano-0.6b"
|
||||
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
||||
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto", device_map="auto")
|
||||
|
||||
messages = [{"role": "user", "content": "Hello!"}]
|
||||
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
||||
inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
||||
outputs = model.generate(**inputs, max_new_tokens=512)
|
||||
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
|
||||
```
|
||||
|
||||
## API Access
|
||||
|
||||
```bash
|
||||
curl https://api.hanzo.ai/v1/chat/completions \
|
||||
-H "Authorization: Bearer $HANZO_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"model": "zen-nano-0.6b", "messages": [{"role": "user", "content": "Hello"}]}'
|
||||
```
|
||||
|
||||
Get your API key at [console.hanzo.ai](https://console.hanzo.ai) — $5 free credit on signup.
|
||||
|
||||
## Model Details
|
||||
|
||||
| Attribute | Value |
|
||||
|-----------|-------|
|
||||
| Parameters | 0.6B |
|
||||
| Architecture | Zen MoDE |
|
||||
| Context | 32K tokens |
|
||||
| License | Apache 2.0 |
|
||||
|
||||
## License
|
||||
|
||||
Apache 2.0
|
||||
Reference in New Issue
Block a user