初始化项目,由ModelHub XC社区提供模型
Model: zenlm/zen3-nano Source: Original Platform
This commit is contained in:
71
README.md
Normal file
71
README.md
Normal file
@@ -0,0 +1,71 @@
|
||||
---
|
||||
library_name: transformers
|
||||
pipeline_tag: text-generation
|
||||
base_model: Qwen/Qwen3-8B
|
||||
tags:
|
||||
- text-generation
|
||||
- conversational
|
||||
- multilingual
|
||||
- zen
|
||||
- zen3
|
||||
- hanzo
|
||||
- zenlm
|
||||
license: apache-2.0
|
||||
language:
|
||||
- en
|
||||
---
|
||||
|
||||
# zen3-nano
|
||||
|
||||
Compact, capable language model for fast inference, part of the OSS-clean Zen model line.
|
||||
|
||||
Repackaged from [Qwen/Qwen3-8B](https://huggingface.co/Qwen/Qwen3-8B) (apache-2.0, Alibaba Qwen). **Not trained from scratch** — a permissively-licensed redistribution for the OSS-clean Zen model line.
|
||||
|
||||
## Specs
|
||||
|
||||
| Property | Value |
|
||||
|----------|-------|
|
||||
| Parameters | 8B (dense) |
|
||||
| Architecture | Qwen3 (`Qwen3ForCausalLM`) |
|
||||
| Context Length | 40K tokens |
|
||||
| Generation | Zen3 |
|
||||
|
||||
## Usage
|
||||
|
||||
```python
|
||||
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||
|
||||
model = AutoModelForCausalLM.from_pretrained("zenlm/zen3-nano", torch_dtype="auto")
|
||||
tokenizer = AutoTokenizer.from_pretrained("zenlm/zen3-nano")
|
||||
|
||||
messages = [{"role": "user", "content": "Explain quantum computing in simple terms."}]
|
||||
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], skip_special_tokens=True))
|
||||
```
|
||||
|
||||
## API Access
|
||||
|
||||
Also served via the Hanzo AI API:
|
||||
|
||||
```python
|
||||
from openai import OpenAI
|
||||
|
||||
client = OpenAI(base_url="https://api.hanzo.ai/v1", api_key="YOUR_KEY")
|
||||
response = client.chat.completions.create(
|
||||
model="zen3-nano",
|
||||
messages=[{"role": "user", "content": "Hello"}],
|
||||
)
|
||||
print(response.choices[0].message.content)
|
||||
```
|
||||
|
||||
Get your API key at [console.hanzo.ai](https://console.hanzo.ai) — $5 free credit on signup.
|
||||
|
||||
## License
|
||||
|
||||
`apache-2.0`. Upstream: **Qwen/Qwen3-8B** by Alibaba Qwen. Upstream LICENSE/NOTICE retained in-repo.
|
||||
|
||||
---
|
||||
|
||||
*Zen LM is developed by [Hanzo AI](https://hanzo.ai) — Frontier AI infrastructure.*
|
||||
Reference in New Issue
Block a user