Text Generation
Transformers
Safetensors
English
Chinese
xing4_0
roleplay
conversational
MoE
fine-tuned
TeleChat
Xing
Ascend
MindSpore
custom_code
Instructions to use hunter-P/roleplay-Xing4.0-29B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hunter-P/roleplay-Xing4.0-29B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hunter-P/roleplay-Xing4.0-29B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("hunter-P/roleplay-Xing4.0-29B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use hunter-P/roleplay-Xing4.0-29B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "hunter-P/roleplay-Xing4.0-29B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hunter-P/roleplay-Xing4.0-29B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/hunter-P/roleplay-Xing4.0-29B
- SGLang
How to use hunter-P/roleplay-Xing4.0-29B 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 "hunter-P/roleplay-Xing4.0-29B" \ --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": "hunter-P/roleplay-Xing4.0-29B", "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 "hunter-P/roleplay-Xing4.0-29B" \ --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": "hunter-P/roleplay-Xing4.0-29B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use hunter-P/roleplay-Xing4.0-29B with Docker Model Runner:
docker model run hf.co/hunter-P/roleplay-Xing4.0-29B
RolePlay-Xing4.0-29B
This model is a fine-tuned version of Xing4.0-29B-A4B, specifically optimized for vertical domain tasks related to Roleplay. It is designed to deliver an immersive conversational experience, maintain stable character personas, and handle complex narrative progression.
Base Model Highlights
The base model is Xing4.0-29B-A4B (formerly known as the TeleChat series), developed by China Telecom Artificial Intelligence Technology Co., Ltd.
- Efficient MoE Architecture: With 29B total parameters and only 4B activated per token, it achieves an excellent balance between inference efficiency and performance.
- Extended Context Support: Natively supports a 256K context length, extensible to 512K, making it highly suitable for long-form roleplay, world-building memory, and deep multi-turn dialogues.
- Domestic Hardware Ecosystem: It is the first model of this scale trained entirely on the Ascend NPU platform with the MindSpore framework, deeply optimized for complex engineering tasks.
Training Details
- Fine-tuning Task: Roleplay / Character Persona.
- Training Data: The fine-tuning dataset comprises 6,247 high-quality multi-turn roleplay dialogues. It covers 1,346 distinct characters/personas, with an average of 6 interaction turns per dialogue. This ensures strong context retention and persona consistency during extended conversations.
- Training Method: Full-parameter fine-tuning.
- Training Hardware: Ascend NPU cluster.
- Training Framework: MindSpore.
Quickstart
Inference
roleplay-Xing4.0-29B-A4B can be accessed via an OpenAI-compatible API.
from openai import OpenAI
client = OpenAI(
base_url="your-base-url",
api_key="your-api-key",
)
completion = client.chat.completions.create(
model="Xing4.0-29B-A4B",
messages=[{"role": "user", "content": "hi! Mr Bench."}],
temperature=1.0,
top_p=0.95,
extra_body={
"repetition_penalty": 1.05,
"skip_special_tokens": False,
"spaces_between_special_tokens": False,
"chat_template_kwargs": {
"enable_thinking": True, # Set to False to disable thinking
},
},
)
print(completion.choices[0].message.content)
Recommended Parameters
| temperature | top_p | repetition_penalty |
|---|---|---|
| 1.1 | 0.95 | 1.02 |
- Downloads last month
- 180
Model tree for hunter-P/roleplay-Xing4.0-29B
Base model
XingChen-AGI/Xing4.0-29B-A4B