Text Generation
Transformers
ONNX
Safetensors
Chinese
t5
text2text-generation
text-generation-inference
custom_code
Instructions to use charent/ChatLM-mini-Chinese with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use charent/ChatLM-mini-Chinese with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="charent/ChatLM-mini-Chinese", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("charent/ChatLM-mini-Chinese", trust_remote_code=True) model = AutoModelForSeq2SeqLM.from_pretrained("charent/ChatLM-mini-Chinese", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use charent/ChatLM-mini-Chinese with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "charent/ChatLM-mini-Chinese" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "charent/ChatLM-mini-Chinese", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/charent/ChatLM-mini-Chinese
- SGLang
How to use charent/ChatLM-mini-Chinese 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 "charent/ChatLM-mini-Chinese" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "charent/ChatLM-mini-Chinese", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "charent/ChatLM-mini-Chinese" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "charent/ChatLM-mini-Chinese", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use charent/ChatLM-mini-Chinese with Docker Model Runner:
docker model run hf.co/charent/ChatLM-mini-Chinese
Thank you very much for your excellent work!非常感谢您的出色的工作!
#1
by wukongai - opened
This can serve as a starter learning model!
这个可以作为一个入门的学习模型!
另外,能否提供一下q8、q16的gguf量化权重,我想在cpu上跑一下,肯定非常欢快!
另外,能否提供一下q8、q16的gguf量化权重,我想在cpu上跑一下,肯定非常欢快!
But t5 models seem not to be able to transfer to GGUF format.
t5模型应该不能gguf量化,至少llama.cpp对其没有支持
另外,能否提供一下q8、q16的gguf量化权重,我想在cpu上跑一下,肯定非常欢快!
暂时没有发布量化模型的计划,发布的是float32权重,可以直接在cpu上进行推理,200M的参数在cpu上推理已经很快了。如果有需要,你可以自己做量化(可能需要cuda设备),安装'bitsandbytes':
# linux:
pip install bitsandbytes
# windows
python -m pip install bitsandbytes --prefer-binary --extra-index-url=https://jllllll.github.io/bitsandbytes-windows-webui
8bit量化代码如下:
from transformers import AutoModelForSeq2SeqLM
model = AutoModelForSeq2SeqLM.from_pretrained('charent/ChatLM-mini-Chinese', trust_remote_code=True, device_map="auto", load_in_8bit=True)
model.save_pretrained('./model_8bit')
收到,谢谢!
请问一下,RLHF训练过程的奖励模型在哪里体现呢 ?
好兄弟这实在是泰裤辣❤❤❤!!!