Yonetix-V1

广州柚鸟科技有限公司旗下 YONETIX 品牌首款大语言模型

Yonetix-V1 是基于 Decoder-only Transformer 架构从零训练的大语言模型,113.5M 参数,支持中英文对话。

模型信息

项目 规格
参数量 113.5M
架构 Decoder-only Transformer + RoPE + SwiGLU
词表 367 tokens(字符级,支持中英文+标点+数字)
训练数据 5万条合成语料,200+主题模板
训练硬件 NVIDIA RTX 3060 12GB
模型大小 ~434MB (FP32)

文件清单

文件 说明
model.pt 模型权重(PyTorch state_dict)
config.json 模型配置
vocab.txt 词表(\t 分隔:index\ttoken)
model.py 模型架构代码
use_model.py 快速使用脚本

使用方法

import torch
import json
from model import YonetixTransformer, ModelConfig

# 加载配置和模型
with open("config.json") as f:
    config = ModelConfig(**json.load(f))
model = YonetixTransformer(config)
model.load_state_dict(torch.load("model.pt", map_location="cpu", weights_only=True))
model.eval()
print(f"✅ 模型加载完成,参数量: {sum(p.numel() for p in model.parameters()) / 1e6:.2f}M")

# 加载词表
vocab = {}
with open("vocab.txt") as f:
    for line in f:
        idx, token = line.strip().split("\t")
        vocab[int(idx)] = token
# 特殊 token
PAD, UNK, BOS, EOS = 0, 1, 2, 3

def encode(text, max_len=128):
    """编码文本到 token ids"""
    ids = [BOS]
    for ch in text:
        found = False
        for idx, token in vocab.items():
            if idx < 4:  # 跳过特殊 token
                continue
            if token == ch:
                ids.append(idx)
                found = True
                break
        if not found:
            ids.append(UNK)
    ids.append(EOS)
    return torch.tensor([ids[:max_len]])

def decode(ids):
    """解码 token ids 到文本"""
    return "".join(vocab.get(int(i), "") for i in ids if int(i) > 3)

# 对话
def chat(prompt, max_new_tokens=128):
    input_ids = encode(prompt)
    output_ids = model.generate(input_ids, max_new_tokens=max_new_tokens)
    reply = output_ids[0][input_ids.size(1):].tolist()
    return decode(reply)

print(chat("你好,你是谁?"))

关于 YONETIX

YONETIX 是广州柚鸟科技有限公司旗下品牌,专注于全球实时数据可视化与人工智能技术研发。

官方网站: https://www.shhhh.cn/

Downloads last month
101
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support