Text Generation
Transformers
PyTorch
English
Chinese
cn
llama
transformer
封神榜
text-generation-inference
Instructions to use IDEA-CCNL/Ziya2-13B-Chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use IDEA-CCNL/Ziya2-13B-Chat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="IDEA-CCNL/Ziya2-13B-Chat")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("IDEA-CCNL/Ziya2-13B-Chat") model = AutoModelForCausalLM.from_pretrained("IDEA-CCNL/Ziya2-13B-Chat") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use IDEA-CCNL/Ziya2-13B-Chat with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "IDEA-CCNL/Ziya2-13B-Chat" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IDEA-CCNL/Ziya2-13B-Chat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/IDEA-CCNL/Ziya2-13B-Chat
- SGLang
How to use IDEA-CCNL/Ziya2-13B-Chat 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 "IDEA-CCNL/Ziya2-13B-Chat" \ --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": "IDEA-CCNL/Ziya2-13B-Chat", "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 "IDEA-CCNL/Ziya2-13B-Chat" \ --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": "IDEA-CCNL/Ziya2-13B-Chat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use IDEA-CCNL/Ziya2-13B-Chat with Docker Model Runner:
docker model run hf.co/IDEA-CCNL/Ziya2-13B-Chat
关于<eod>的疑似bug
#1
by woody960808 - opened
tokenizer.json里面的add_tokens是'<eod>'
但是added_tokens.json里面的是<eod>
原始模型推理没有问题,但是finetune之后会出现异常结果
@woody960808 感谢使用!我们上周发现了这个问题,立即修复了,非常抱歉。tokenizer里的应该和added_tokens里的对齐,现在已经去掉了引号。你可以试试更改之后finetune是否还有异常,如果还有问题也可以把代码和数据数量等post上来~