Instructions to use google/translategemma-4b-it with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/translategemma-4b-it with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="google/translategemma-4b-it")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("google/translategemma-4b-it", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use google/translategemma-4b-it with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "google/translategemma-4b-it" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "google/translategemma-4b-it", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/google/translategemma-4b-it
- SGLang
How to use google/translategemma-4b-it 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 "google/translategemma-4b-it" \ --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": "google/translategemma-4b-it", "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 "google/translategemma-4b-it" \ --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": "google/translategemma-4b-it", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use google/translategemma-4b-it with Docker Model Runner:
docker model run hf.co/google/translategemma-4b-it
Handling Unknown Source Languages in Translation Templates
5
#19 opened 22 days ago
by
sandeep1401
Add missing fil language code
#18 opened about 1 month ago
by
mjpohja
TranslateGemma Terminology Control and Context Support for Scientific Translation
1
#17 opened about 2 months ago
by
EliasKim
Passing context to the model
1
#16 opened about 2 months ago
by
Mahendranath
After llama.cpp rework of template parsing, can no longer load this model
👍 1
2
#15 opened 3 months ago
by
quasoft2
Support for Mossi (mos) language code in TranslateGemma chat template
5
#14 opened 4 months ago
by
madoss
Significant Performance Regression and Content Omission after 8-bit Quantization
1
#13 opened 4 months ago
by
Emily901017
finetune
3
#11 opened 4 months ago
by
Dehsahk-AI
new discuss
3
#10 opened 4 months ago
by
tegal12
how to use vllm to serve google/translategemma-4b-it & how to use it?
7
#9 opened 4 months ago
by
ggmarks
zh-CH looks like a typo of zh-CN?
2
#8 opened 5 months ago
by
lirc571
Performance?
4
#6 opened 5 months ago
by
Budenloui
Are there plans to provide task or litertlm versions for the litt-literature community?
👍 2
4
#5 opened 5 months ago
by
willopcbeta
Example script for fine-tuning on a new destination language
4
#4 opened 5 months ago
by
gmallen
Extremely slow inference (~130s) on RTX 3080 - "slow image processor" warning
👀 10
3
#3 opened 5 months ago
by
simpple28
input context -2k
1
#2 opened 5 months ago
by
LittleTaro
Installation Video and Testing - Step by Step
3
#1 opened 5 months ago
by
fahdmirzac