Instructions to use phi0112358/Riva-Translate-4B-Instruct-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use phi0112358/Riva-Translate-4B-Instruct-GGUF with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("translation", model="phi0112358/Riva-Translate-4B-Instruct-GGUF") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("phi0112358/Riva-Translate-4B-Instruct-GGUF", dtype="auto") - llama-cpp-python
How to use phi0112358/Riva-Translate-4B-Instruct-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="phi0112358/Riva-Translate-4B-Instruct-GGUF", filename="riva-translate-4b-instruct-q4_k_m.gguf", )
llm.create_chat_completion( messages = "\"ะะตะฝั ะทะพะฒัั ะะพะปััะณะฐะฝะณ ะธ ั ะถะธะฒั ะฒ ะะตัะปะธะฝะต\"" )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use phi0112358/Riva-Translate-4B-Instruct-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf phi0112358/Riva-Translate-4B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf phi0112358/Riva-Translate-4B-Instruct-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf phi0112358/Riva-Translate-4B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf phi0112358/Riva-Translate-4B-Instruct-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf phi0112358/Riva-Translate-4B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf phi0112358/Riva-Translate-4B-Instruct-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf phi0112358/Riva-Translate-4B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf phi0112358/Riva-Translate-4B-Instruct-GGUF:Q4_K_M
Use Docker
docker model run hf.co/phi0112358/Riva-Translate-4B-Instruct-GGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use phi0112358/Riva-Translate-4B-Instruct-GGUF with Ollama:
ollama run hf.co/phi0112358/Riva-Translate-4B-Instruct-GGUF:Q4_K_M
- Unsloth Studio new
How to use phi0112358/Riva-Translate-4B-Instruct-GGUF 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 phi0112358/Riva-Translate-4B-Instruct-GGUF 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 phi0112358/Riva-Translate-4B-Instruct-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for phi0112358/Riva-Translate-4B-Instruct-GGUF to start chatting
- Docker Model Runner
How to use phi0112358/Riva-Translate-4B-Instruct-GGUF with Docker Model Runner:
docker model run hf.co/phi0112358/Riva-Translate-4B-Instruct-GGUF:Q4_K_M
- Lemonade
How to use phi0112358/Riva-Translate-4B-Instruct-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull phi0112358/Riva-Translate-4B-Instruct-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Riva-Translate-4B-Instruct-GGUF-Q4_K_M
List all available models
lemonade list
Converted to GGUF format from nvidia/Riva-Translate-4B-Instruct using llama.cpp via ggml.ai's GGUF-my-repo space. Refer to original model card for more details.
Riva-Translate-4B-Instruct
tldr; use Riva-Translate-4B-Instruct with llama.cpp
# Install llama.cpp through **brew** (works on Mac & Linux)
brew install llama.cpp
# Start the llama.cpp CLI or the Server. FYI: The Server is OpenAI
# compatible and has a built-in lightweight and nice WebUI
llama-cli --hf-repo phi0112358/Riva-Translate-4B-Instruct-Q8_0-GGUF \
-p "The meaning to life and the universe is"
# Or Server
llama-server --hf-repo phi0112358/Riva-Translate-4B-Instruct-Q8_0-GGUF \
-c 2048 --host 127.0.0.1 --port 8080
# You can now open 'http://localhost:8080' in your Webbrowser and
# start interacting with the language model
Model Overview
The Riva-Translate-4B-Instruct Neural Machine Translation model translates text in 12 languages. The supported languages are: English(en), German(de), European Spanish(es-ES), LATAM Spanish(es-US), France(fr), Brazillian Portugese(pt-BR), Russian(ru), Simplified Chinese(zh-CN), Traditional Chinese(zh-TW), Japanese(ja),Korean(ko), Arabic(ar). This model was developed based on the decoder-only Transformer architecture. It is a fine-tuned version of a 4B Base model that was pruned and distilled from nvidia/Mistral-NeMo-Minitron-8B-Base using our LLM compression technique. The model was trained using a multi-stage CPT and SFT. It uses tiktoken as the tokenizer. The model supports a context length of 8K tokens. Riva-Translate-4B-Instruct was trained between Jan 2025 and April 2025.
Prompt Format:
Use the following prompt template, which was used to fine-tune the model. The model may not perform optimally without it.
<s>System
{system prompt}</s>
<s>User
{user prompt}</s>
<s>Assistant\n
- Note that a newline character (\n) should be added after
<s>Assistantas a generation prompt. - Note that users are required to use the correct language name in the prompt: 'ar': 'Arabic', 'en': 'English', 'de': 'German', 'es-es': 'European Spanish', 'es-us': 'Latin American Spanish', 'fr': 'French', 'ja': 'Japanese', 'ko': 'Korean', 'ru': 'Russian', 'zh-cn': 'Simplified Chinese', 'zh-tw': 'Traditional Chinese', 'pt-br': 'Brazilian Portuguese'
For example, to translate an English sentence into Simplified Chinese:
<s>System
You are an expert at translating text from English to Simplified Chinese.</s>
<s>User
What is the Simplified Chinese translation of the sentence: The GRACE mission is a collaboration between the NASA and German Aerospace Center.?</s>
<s>Assistant
License
NVIDIA Open Model License Agreement
Use Case Restrictions:
Abide by NVIDIA Open Model License Agreement
- Downloads last month
- 65
4-bit
8-bit
Model tree for phi0112358/Riva-Translate-4B-Instruct-GGUF
Base model
nvidia/Mistral-NeMo-Minitron-8B-Base