Text Generation
Transformers
Safetensors
English
Chinese
text-generation-inference
unsloth
qwen2
trl
conversational
Instructions to use FradSer/DeepTranslate-R1-1.5B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FradSer/DeepTranslate-R1-1.5B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FradSer/DeepTranslate-R1-1.5B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("FradSer/DeepTranslate-R1-1.5B", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use FradSer/DeepTranslate-R1-1.5B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FradSer/DeepTranslate-R1-1.5B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FradSer/DeepTranslate-R1-1.5B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/FradSer/DeepTranslate-R1-1.5B
- SGLang
How to use FradSer/DeepTranslate-R1-1.5B 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 "FradSer/DeepTranslate-R1-1.5B" \ --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": "FradSer/DeepTranslate-R1-1.5B", "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 "FradSer/DeepTranslate-R1-1.5B" \ --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": "FradSer/DeepTranslate-R1-1.5B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio new
How to use FradSer/DeepTranslate-R1-1.5B with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for FradSer/DeepTranslate-R1-1.5B to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for FradSer/DeepTranslate-R1-1.5B to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for FradSer/DeepTranslate-R1-1.5B to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="FradSer/DeepTranslate-R1-1.5B", max_seq_length=2048, ) - Docker Model Runner
How to use FradSer/DeepTranslate-R1-1.5B with Docker Model Runner:
docker model run hf.co/FradSer/DeepTranslate-R1-1.5B
Update README.md
Browse files
README.md
CHANGED
|
@@ -10,14 +10,34 @@ tags:
|
|
| 10 |
license: apache-2.0
|
| 11 |
language:
|
| 12 |
- en
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
---
|
| 14 |
|
| 15 |
-
#
|
| 16 |
|
| 17 |
-
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
This qwen2 model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
|
| 22 |
|
| 23 |
-
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
|
|
|
|
| 10 |
license: apache-2.0
|
| 11 |
language:
|
| 12 |
- en
|
| 13 |
+
- zh
|
| 14 |
+
datasets:
|
| 15 |
+
- FradSer/DeepSeek-R1-Distilled-Translate-en-zh_CN-39k
|
| 16 |
+
pipeline_tag: text-generation
|
| 17 |
---
|
| 18 |
|
| 19 |
+
## DeepTranslate-R1-1.5B 概述
|
| 20 |
|
| 21 |
+
DeepTranslate-R1-1.5B 是一个从 DeepSeek-R1-Distilled-Qwen-1.5B 微调而来的语言模型,专门用于英文和中文之间的高质量翻译。我们的模型使用监督式微调(SFT)技术,在仅有1.5B参数的计算效率下实现高质量翻译。
|
| 22 |
+
|
| 23 |
+
## 输出模板
|
| 24 |
+
|
| 25 |
+
```
|
| 26 |
+
TEMPLATE """{{- if .System }}{{ .System }}{{ end }}
|
| 27 |
+
{{- range $i, $_ := .Messages }}
|
| 28 |
+
{{- $last := eq (len (slice $.Messages $i)) 1}}
|
| 29 |
+
{{- if eq .Role "user" }}<|User|>{{ .Content }}
|
| 30 |
+
{{- else if eq .Role "assistant" }}<|Assistant|>{{ .Content }}{{- if not $last }}<|end▁of▁sentence|>{{- end }}
|
| 31 |
+
{{- end }}
|
| 32 |
+
{{- if and $last (ne .Role "assistant") }}<|Assistant|>{{- end }}
|
| 33 |
+
{{- end }}"""
|
| 34 |
+
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
## 作者
|
| 38 |
+
- [歸藏 (guizang.ai)](https://x.com/op7418)
|
| 39 |
+
- [FradSer](https://x.com/FradSer)
|
| 40 |
|
| 41 |
This qwen2 model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
|
| 42 |
|
| 43 |
+
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
|