Instructions to use TJUNLP/FuxiTranyu-8B-DPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TJUNLP/FuxiTranyu-8B-DPO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TJUNLP/FuxiTranyu-8B-DPO", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("TJUNLP/FuxiTranyu-8B-DPO", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use TJUNLP/FuxiTranyu-8B-DPO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TJUNLP/FuxiTranyu-8B-DPO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TJUNLP/FuxiTranyu-8B-DPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/TJUNLP/FuxiTranyu-8B-DPO
- SGLang
How to use TJUNLP/FuxiTranyu-8B-DPO 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 "TJUNLP/FuxiTranyu-8B-DPO" \ --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": "TJUNLP/FuxiTranyu-8B-DPO", "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 "TJUNLP/FuxiTranyu-8B-DPO" \ --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": "TJUNLP/FuxiTranyu-8B-DPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use TJUNLP/FuxiTranyu-8B-DPO with Docker Model Runner:
docker model run hf.co/TJUNLP/FuxiTranyu-8B-DPO
Upload config.json with huggingface_hub
Browse files- config.json +7 -8
config.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "/
|
| 3 |
"activation_function": "gelu_fast",
|
| 4 |
"architectures": [
|
| 5 |
"FuxiTranyuForCausalLM"
|
|
@@ -10,8 +10,8 @@
|
|
| 10 |
"AutoConfig": "configuration_fuxitranyu.FuxiTranyuConfig",
|
| 11 |
"AutoModelForCausalLM": "modeling_fuxitranyu.FuxiTranyuForCausalLM"
|
| 12 |
},
|
| 13 |
-
"bos_token_id":
|
| 14 |
-
"eos_token_id":
|
| 15 |
"hidden_size": 4096,
|
| 16 |
"initializer_range": 0.01,
|
| 17 |
"intermediate_size": 16384,
|
|
@@ -20,15 +20,14 @@
|
|
| 20 |
"num_attention_heads": 32,
|
| 21 |
"num_hidden_layers": 30,
|
| 22 |
"num_key_value_heads": 32,
|
| 23 |
-
"pad_token_id": 250681,
|
| 24 |
"pretraining_tp": 1,
|
| 25 |
"rms_norm_eps": 1e-05,
|
| 26 |
"rope_scaling": null,
|
| 27 |
"rope_theta": 10000.0,
|
| 28 |
"tie_word_embeddings": false,
|
| 29 |
"tokenizer_class": "GPT2TokenizerFast",
|
| 30 |
-
"torch_dtype": "
|
| 31 |
-
"transformers_version": "4.
|
| 32 |
-
"use_cache":
|
| 33 |
-
"vocab_size":
|
| 34 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "/home/s2022244109/rrjin/trl_data/checkpoint/sft_002/checkpoint-3963",
|
| 3 |
"activation_function": "gelu_fast",
|
| 4 |
"architectures": [
|
| 5 |
"FuxiTranyuForCausalLM"
|
|
|
|
| 10 |
"AutoConfig": "configuration_fuxitranyu.FuxiTranyuConfig",
|
| 11 |
"AutoModelForCausalLM": "modeling_fuxitranyu.FuxiTranyuForCausalLM"
|
| 12 |
},
|
| 13 |
+
"bos_token_id": 0,
|
| 14 |
+
"eos_token_id": 0,
|
| 15 |
"hidden_size": 4096,
|
| 16 |
"initializer_range": 0.01,
|
| 17 |
"intermediate_size": 16384,
|
|
|
|
| 20 |
"num_attention_heads": 32,
|
| 21 |
"num_hidden_layers": 30,
|
| 22 |
"num_key_value_heads": 32,
|
|
|
|
| 23 |
"pretraining_tp": 1,
|
| 24 |
"rms_norm_eps": 1e-05,
|
| 25 |
"rope_scaling": null,
|
| 26 |
"rope_theta": 10000.0,
|
| 27 |
"tie_word_embeddings": false,
|
| 28 |
"tokenizer_class": "GPT2TokenizerFast",
|
| 29 |
+
"torch_dtype": "bfloat16",
|
| 30 |
+
"transformers_version": "4.44.2",
|
| 31 |
+
"use_cache": false,
|
| 32 |
+
"vocab_size": 250680
|
| 33 |
}
|