Instructions to use tcmofashi/mai_replier-9b-v3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tcmofashi/mai_replier-9b-v3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tcmofashi/mai_replier-9b-v3") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("tcmofashi/mai_replier-9b-v3") model = AutoModelForMultimodalLM.from_pretrained("tcmofashi/mai_replier-9b-v3", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tcmofashi/mai_replier-9b-v3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tcmofashi/mai_replier-9b-v3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tcmofashi/mai_replier-9b-v3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tcmofashi/mai_replier-9b-v3
- SGLang
How to use tcmofashi/mai_replier-9b-v3 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 "tcmofashi/mai_replier-9b-v3" \ --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": "tcmofashi/mai_replier-9b-v3", "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 "tcmofashi/mai_replier-9b-v3" \ --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": "tcmofashi/mai_replier-9b-v3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use tcmofashi/mai_replier-9b-v3 with Docker Model Runner:
docker model run hf.co/tcmofashi/mai_replier-9b-v3
mai_replier_9b_v3 โ ๅคๅคๅๅคๅจๆ ผๅผ ยท ๆ ๆ็ปด้พ ยท ๅคๆจกๆไบค้ๅตๅ ฅ
MaiBotใๅๅคๅจ๏ผreplier๏ผใ็ 9B ๅฎๆดๆจกๅ๏ผๅทฒๅๅนถ๏ผๅผ็ฎฑๅณ็จ๏ผ๏ผๅคๅคๅๅคๅจๆ ผๅผ / ๆ ๆ็ปด้พ / ๅคๆจกๆไบค้ๅตๅ ฅใ ๅบไบ Qwen3.5-9B๏ผ
qwen3_5_text๏ผ24 ๅฑ linear_attention GDN + 8 ๅฑ full_attention๏ผvocab 248320๏ผๅพฎ่ฐใ
ไธใ่ฟๆฏไปไน
่ฟๆฏ MaiBot ็ๆไธญ็ใๅๅคๅจใๆจกๅโโไธไธช่ทๅจ QQ ็พค้ใๆฎๆผๅ ทไฝ่ง่ฒไบบ่ฎพๅ่จ็็พค่ botใๅฎ่ฏปๅๅคๅคๅๅคๅจๆ ผๅผๆธฒๆ็็พค่ไธไธๆ๏ผsystem ไบบ่ฎพ + user ๅฎๆดๆจกๆฟๅๆถๆฏ๏ผๅพ็ๅ ่ๅตๅ ฅๅฏนๅบๅ่จไฝ็ฝฎ๏ผ๏ผ็ดๆฅ่พๅบไธๅฅ็ฌฆๅไบบ่ฎพ็็ฎๆดๅฃ่ฏญๅๅๅค๏ผๆ ๆ็ปด้พ๏ผใ
| ้กน | ๅผ |
|---|---|
| ๆถๆ | Qwen3.5-9B๏ผQwen3_5ForConditionalGeneration๏ผ24 ๅฑ GDN + 8 ๅฑ full_attention๏ผ |
| ็ฒพๅบฆ | bf16๏ผ18GB๏ผ |
| ๅพฎ่ฐๆนๅผ | LoRA SFT๏ผr=64, alpha=32๏ผ๏ผๅทฒๅๅนถไธบๅฎๆดๆ้ |
| ๆ็ปด้พ | ๆ ๏ผenable_thinking=False๏ผ็ดๆฅ่พๅบๅๅค๏ผ |
| ๅคๆจกๆ | ๆฏๆ๏ผๅพ็ไบค้ๅตๅ ฅๅฏนๅบๅ่จไฝ็ฝฎ๏ผ |
| ๆธฒๆๅจ | maibot-dev-retro-v6_2@3a09e4cca2ae |
ไบใ่พๅ ฅๆ ผๅผ๏ผๅคๅคๅๅคๅจ๏ผsystem ไบบ่ฎพ + user ๅฎๆดๆจกๆฟๅๆถๆฏ๏ผ
2.1 ๅฎๆด็ปๆ
<|im_start|>system
ไฝ ็ๅๅญๆฏ{่ง่ฒๅ}{๏ผไนๆไบบๅซไฝ {ๅซๅ}}ใ
{ไบบ่ฎพๆ่ฟฐ}<|im_end|>
<|im_start|>user
ไฝ ๆญฃๅจqq็พค้่ๅคฉ๏ผไธ้ขๆฏ็พค้ๆญฃๅจ่็ๅ
ๅฎน
ๅ
ถไธญๆ ๆณจ {่ง่ฒๅ}(ไฝ ) ็ๅ่จๆฏไฝ ่ชๅทฑ็ๅ่จ๏ผ่ฏทๆณจๆๅบๅ:
ๅฝๅๆถ้ด๏ผYYYY-MM-DD HH:MM:SS
[ๅฏน่ฏๅๅฒ่ก๏ผ่ง 2.2]
็ฐๅจ{็ฎๆ ๅ่จไบบ}่ฏด็๏ผ{็ฎๆ ๆถๆฏ}ใๅผ่ตทไบไฝ ็ๆณจๆใ
{planner guidance๏ผๅฏ้๏ผ}
ไฝ ๆญฃๅจ็พค้่ๅคฉ,็ฐๅจ่ฏทไฝ ่ฏป่ฏปไนๅ็่ๅคฉ่ฎฐๅฝ๏ผๆๆกๅฝๅ็่ฏ้ข๏ผ็ถๅ็ปๅบๆฅๅธธไธ็ฎ็ญ็ๅๅคใ
ๆๅฅฝไธๆฌกๅฏนไธไธช่ฏ้ข่ฟ่กๅๅค๏ผๅ
ๅพๅฐๅฆๆ่
ๅๅคๅ
ๅฎนๅคชไนฑใ
่ฏทๆณจๆๆๆก่ๅคฉๅ
ๅฎนใ
{reply_style๏ผไบบ่ฎพ่ฏญๆฐ็บฆๆ๏ผ}
่ฏทไธ่ฆ่พๅบ่ฟๆณ่ฟ่งๅ
ๅฎน๏ผไธ่ฆ่พๅบ่ฒๆ
๏ผๆดๅ๏ผๆฟๆฒป็ธๅ
ณๅ
ๅฎน๏ผๅฆๆๆๆๅ
ๅฎน๏ผ่ฏท่ง้ฟใ
่ฏทๆณจๆไธ่ฆ่พๅบๅคไฝๅ
ๅฎน๏ผๅช่พๅบๅ่จๅ
ๅฎนๅฐฑๅฅฝใ
็ฐๅจ๏ผไฝ ่ฏด๏ผ<|im_end|>
<|im_start|>assistant
{ไธๅฅ็ฌฆๅไบบ่ฎพ็ๅๅค}<|im_end|>
2.2 ๅฏน่ฏๅๅฒ่กๆ ผๅผ
ๆฏๆกๆถๆฏไธ่ก๏ผ[HH:MM:SS] ๅ่จไบบ ่ฏด๏ผๅ
ๅฎน
- bot ่ชๅทฑ็ๅ่จ๏ผ
[HH:MM:SS] {่ง่ฒๅ}(ไฝ )่ฏด๏ผๅ ๅฎน - ๅๅคๅผ็จ๏ผ
[ๅๅคไบ{่ขซๅๅคไบบ}็ๆถๆฏ: {่ขซๅผๅ ๅฎน}] - @ ๆๅ๏ผ
@ๆไบบ - ่กจๆ
ๅ
๏ผ
[่กจๆ ๅ : ๅๅญ]๏ผๅพ็ๅ ไฝ[ๅพ็] - ไบไปถ๏ผ
[ไบไปถ-็พคๆถๆฏๆคๅ] X ๆคๅไบไธๆกๆถๆฏ็ญ
ไธใๅคๆจกๆ๏ผไบค้ๅตๅ ฅ
user ๆถๆฏ็ content ๆฏ parts ๆฐ็ป๏ผๆๆฌๅๅพๅๆๅ ไฝ็ฌฆๅๅงไฝ็ฝฎไบคๆฟๆๅธ๏ผ
{"role": "user", "content": [
{"type": "text", "text": "โฆ[15:41:13] ๅผ่ฒ็ผ่ฏด๏ผ"},
{"type": "image_url", "image_url": {"url": "data:image/jpeg;base64,โฆ"}},
{"type": "text", "text": "\nโฆ็ฐๅจ๏ผไฝ ่ฏด๏ผ"}
]}
ๅพๅ็ผฉๆพ่งๅ๏ผๆ่ฟ 3 ๅผ ไฟ็ 640 ้ฟ่พน๏ผ็ฌฌ 4 ๅผ ๅๆดๆฉ็ผฉๅฐ 128 ้ฟ่พนใ
ๅใ้ๆ ทๅๆฐ
| ๅๆฐ | ๅผ |
|---|---|
temperature |
0.7 |
top_p |
0.95 |
max_tokens |
256 |
repetition_penalty |
1.15 |
enable_thinking |
False๏ผๅฟ ไผ ๏ผ |
eos_token_id |
[248046, 248044] |
ไบใๅฟซ้ไฝฟ็จ
from transformers import AutoModelForImageTextToText, AutoProcessor
import torch
MODEL = "tcmofashi/mai_replier_9b_v3"
processor = AutoProcessor.from_pretrained(MODEL)
model = AutoModelForImageTextToText.from_pretrained(MODEL, dtype=torch.bfloat16, device_map="auto")
messages = [
{"role": "system", "content": "ไฝ ็ๅๅญๆฏๅฐๅใๆฏไธไธชๅคงไบๅจ่ฏปๅฅณๅคงๅญฆ็โฆ"},
{"role": "user", "content": "ไฝ ๆญฃๅจqq็พค้่ๅคฉโฆ\n็ฐๅจ๏ผไฝ ่ฏด๏ผ"},
]
text = processor.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True,
chat_template_kwargs={"enable_thinking": False},
)
inputs = processor(text=text, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=256, temperature=0.7, top_p=0.95,
repetition_penalty=1.15, do_sample=True, eos_token_id=[248046, 248044])
print(processor.tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
vLLM ้จ็ฝฒ
vllm serve tcmofashi/mai_replier_9b_v3 \
--served-model-name mai_replier_9b_v3 \
--max-model-len 8192 \
--gpu-memory-utilization 0.90 \
--port 8200
ๅ ญใLicense
Apache-2.0
ไธใๅ ่ดฃๅฃฐๆ
ๆฌๆจกๅไธบ QQ ็พค่่ง่ฒๆฎๆผ็จ้็็คพๅบๅฎ้ชไบง็ฉ๏ผ่พๅบไธไปฃ่กจไปปไฝ็ๅฎไบบ็ฉ่ง็นใ
- Downloads last month
- -