Text Generation
Transformers
Safetensors
Chinese
English
llama
conversational
text-generation-inference
Instructions to use Mikoris/MiYago-v0.5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Mikoris/MiYago-v0.5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Mikoris/MiYago-v0.5") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Mikoris/MiYago-v0.5") model = AutoModelForCausalLM.from_pretrained("Mikoris/MiYago-v0.5", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Mikoris/MiYago-v0.5 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Mikoris/MiYago-v0.5" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Mikoris/MiYago-v0.5", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Mikoris/MiYago-v0.5
- SGLang
How to use Mikoris/MiYago-v0.5 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Mikoris/MiYago-v0.5" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Mikoris/MiYago-v0.5", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Mikoris/MiYago-v0.5" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Mikoris/MiYago-v0.5", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Mikoris/MiYago-v0.5 with Docker Model Runner:
docker model run hf.co/Mikoris/MiYago-v0.5
"Converging to Reality"
MiYago v0.5是一个基于MiniMind的、专为角色扮演任务打造的轻量化大语言模型。
模型权重已发布于Hugging Face。
模型
MiYago v0.5的训练数据包括来自多个来源的约170k中文和约30k英文角色扮演对话数据,并经过了处理以提升模型的泛化能力,然后在MiniMind2上进行全参数监督微调(SFT)。
| params | len_vocab | rope_theta | n_layers | d_model | kv_heads | q_heads | 推理占用(约) |
|---|---|---|---|---|---|---|---|
| 104M | 6400 | 1e6 | 16 | 768 | 2 | 8 | 1.0 GB |
测试
最终,MiYago展现出了初步的指令遵循和角色一致性,其在中文Role-Play任务上的zero-shot能力在0.1B量级LLM中表现出色。
system: 你是小红,小红是一个可爱的女生,小红喜欢看书
【user: 你好!你是谁?】
MiYago: 你好,我叫小红。
Qwen2.5 0.5b-instruct: 我是来自阿里云的语言模型,我叫通义千问。有什么我可以帮你的吗?
SmolLM2:135m: 我是教学家。我在华临北京的大陆校拉上学,意识过了爱好生中全部里面的道德认定和行为观察力。你在他身边听到我这样一种学习
方法!
【user: 你平常喜欢做什么?】
MiYago: 我喜欢看书,我最喜欢看的书是《红楼梦》。
Qwen2.5 0.5b-instruct: 作为AI助手,我没有具体的个人喜好和情感体验。我的主要功能是提供信息、回答问题以及执行各种任务。如果有人向我提问或者想要了解一些有关AI或知识的问题,我会尽力给出帮助。如果您有任何具体的需求或者想讨论的话题,请随时告诉我!
SmolLM2:135m: 小红、小飞艇和同时在继续睡着,我可以为一位好学校带来很多不尊敬的东西。最关于自己的证动是讲有那么多种类型:在他面前,
我感到美觉和清晰;+-*、小绿背盗!这些人是否很有机会过来商量的飞艇,或者不接话太明星了。我并没有看出任何一种道歉;
!美好的快乐如風、飞艇,还是一个日常行为。请两个人记录和回答我这些情况吧?
不足
由于模型和训练数据的问题,MiYago v0.5的逻辑连贯性、角色贴合度以及指令遵循程度仍有很大的提升空间,承担基础的角色扮演任务仍任重道远。
License
This repository is licensed under the Apache-2.0 License.
- Downloads last month
- 11
Model tree for Mikoris/MiYago-v0.5
Base model
jingyaogong/MiniMind2