Instructions to use trl-internal-testing/tiny-DeepseekV4ForCausalLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use trl-internal-testing/tiny-DeepseekV4ForCausalLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="trl-internal-testing/tiny-DeepseekV4ForCausalLM") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("trl-internal-testing/tiny-DeepseekV4ForCausalLM") model = AutoModelForCausalLM.from_pretrained("trl-internal-testing/tiny-DeepseekV4ForCausalLM") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use trl-internal-testing/tiny-DeepseekV4ForCausalLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "trl-internal-testing/tiny-DeepseekV4ForCausalLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "trl-internal-testing/tiny-DeepseekV4ForCausalLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/trl-internal-testing/tiny-DeepseekV4ForCausalLM
- SGLang
How to use trl-internal-testing/tiny-DeepseekV4ForCausalLM 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 "trl-internal-testing/tiny-DeepseekV4ForCausalLM" \ --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": "trl-internal-testing/tiny-DeepseekV4ForCausalLM", "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 "trl-internal-testing/tiny-DeepseekV4ForCausalLM" \ --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": "trl-internal-testing/tiny-DeepseekV4ForCausalLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use trl-internal-testing/tiny-DeepseekV4ForCausalLM with Docker Model Runner:
docker model run hf.co/trl-internal-testing/tiny-DeepseekV4ForCausalLM
Upload DeepseekV4ForCausalLM
Browse files- config.json +4 -3
- model.safetensors +2 -2
config.json
CHANGED
|
@@ -6,6 +6,7 @@
|
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
"bos_token_id": 0,
|
| 8 |
"compress_ratios": [
|
|
|
|
| 9 |
0,
|
| 10 |
4,
|
| 11 |
128
|
|
@@ -18,7 +19,7 @@
|
|
| 18 |
"compress_rope_theta": 160000.0,
|
| 19 |
"dtype": "bfloat16",
|
| 20 |
"eos_token_id": 1,
|
| 21 |
-
"first_k_dense_replace":
|
| 22 |
"hc_eps": 1e-06,
|
| 23 |
"hc_mult": 4,
|
| 24 |
"hc_sinkhorn_iters": 20,
|
|
@@ -40,8 +41,8 @@
|
|
| 40 |
"norm_topk_prob": true,
|
| 41 |
"num_attention_heads": 4,
|
| 42 |
"num_experts_per_tok": 2,
|
| 43 |
-
"num_hash_layers":
|
| 44 |
-
"num_hidden_layers":
|
| 45 |
"num_key_value_heads": 2,
|
| 46 |
"num_nextn_predict_layers": 1,
|
| 47 |
"o_groups": 8,
|
|
|
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
"bos_token_id": 0,
|
| 8 |
"compress_ratios": [
|
| 9 |
+
0,
|
| 10 |
0,
|
| 11 |
4,
|
| 12 |
128
|
|
|
|
| 19 |
"compress_rope_theta": 160000.0,
|
| 20 |
"dtype": "bfloat16",
|
| 21 |
"eos_token_id": 1,
|
| 22 |
+
"first_k_dense_replace": 2,
|
| 23 |
"hc_eps": 1e-06,
|
| 24 |
"hc_mult": 4,
|
| 25 |
"hc_sinkhorn_iters": 20,
|
|
|
|
| 41 |
"norm_topk_prob": true,
|
| 42 |
"num_attention_heads": 4,
|
| 43 |
"num_experts_per_tok": 2,
|
| 44 |
+
"num_hash_layers": 3,
|
| 45 |
+
"num_hidden_layers": 4,
|
| 46 |
"num_key_value_heads": 2,
|
| 47 |
"num_nextn_predict_layers": 1,
|
| 48 |
"o_groups": 8,
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dcb246e5c57a24315997e93d55e759f78457690fe73efc19e5e58be0bb0f28a5
|
| 3 |
+
size 37758460
|