Instructions to use FradSer/DeepTranslate-R1-1.5B-Preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FradSer/DeepTranslate-R1-1.5B-Preview with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FradSer/DeepTranslate-R1-1.5B-Preview")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("FradSer/DeepTranslate-R1-1.5B-Preview", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use FradSer/DeepTranslate-R1-1.5B-Preview 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-Preview" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FradSer/DeepTranslate-R1-1.5B-Preview", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/FradSer/DeepTranslate-R1-1.5B-Preview
- SGLang
How to use FradSer/DeepTranslate-R1-1.5B-Preview 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-Preview" \ --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": "FradSer/DeepTranslate-R1-1.5B-Preview", "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 "FradSer/DeepTranslate-R1-1.5B-Preview" \ --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": "FradSer/DeepTranslate-R1-1.5B-Preview", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use FradSer/DeepTranslate-R1-1.5B-Preview with Docker Model Runner:
docker model run hf.co/FradSer/DeepTranslate-R1-1.5B-Preview
| license: apache-2.0 | |
| library_name: transformers | |
| language: | |
| - en | |
| - zh | |
| base_model: | |
| - deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B | |
| pipeline_tag: text-generation | |
| datasets: | |
| - FradSer/DeepSeek-R1-Distilled-Translate-en-zh_CN-39k | |
| ## DeepTranslate-R1-1.5B-Preview 概述 | |
| DeepTranslate-R1-1.5B-Preview 是一个从 DeepSeek-R1-Distilled-Qwen-1.5B 微调而来的语言模型,专门用于英文和中文之间的高质量翻译。我们的模型使用监督式微调(SFT)技术,在仅有1.5B参数的计算效率下实现高质量翻译。 | |
| ## 输出模板 | |
| ``` | |
| TEMPLATE """{{- if .System }}{{ .System }}{{ end }} | |
| {{- range $i, $_ := .Messages }} | |
| {{- $last := eq (len (slice $.Messages $i)) 1}} | |
| {{- if eq .Role "user" }}<|User|>{{ .Content }} | |
| {{- else if eq .Role "assistant" }}<|Assistant|>{{ .Content }}{{- if not $last }}<|end▁of▁sentence|>{{- end }} | |
| {{- end }} | |
| {{- if and $last (ne .Role "assistant") }}<|Assistant|>{{- end }} | |
| {{- end }}""" | |
| ``` | |
| ## 作者 | |
| - [歸藏 (guizang.ai)](https://x.com/op7418) | |
| - [FradSer](https://x.com/FradSer) |