Sunbird / translate-nllb-1.3b-salt-4bit

huggingface.co
Total runs: 7
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: April 01 2025
text-generation

Introduction of translate-nllb-1.3b-salt-4bit

Model Details of translate-nllb-1.3b-salt-4bit

4Bit Quantized NLLB Model

This is a 4-bit quantized version of the NLLB (No Language Left Behind) model, built upon the translate-nllb-1.3b-salt-4bit implementation. The quantization process reduces the model size and accelerates inference while preserving competitive translation quality, making it well-suited for resource-constrained environments.

How to Use

Below is an example script demonstrating how to load the model, perform translation, and decode the output:

Make sure to install latest version of BitsAndBytes

pip install -U bitsandbytes

import torch
import transformers

# Load the 4-bit quantized model and tokenizer
model_4bit = transformers.M2M100ForConditionalGeneration.from_pretrained(
    "Sunbird/translate-nllb-1.3b-salt-4bit",
    device_map="auto"
)
tokenizer = transformers.NllbTokenizer.from_pretrained("Sunbird/translate-nllb-1.3b-salt")

# Define the text and language parameters
text = 'Where is the hospital?'
source_language = 'eng'
target_language = 'lug'

# Mapping for language tokens
language_tokens = {
    'eng': 256047,
    'ach': 256111,
    'lgg': 256008,
    'lug': 256110,
    'nyn': 256002,
    'teo': 256006,
}

# Prepare device and tokenize the input text
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
inputs = tokenizer(text, return_tensors="pt").to(device)
inputs['input_ids'][0][0] = language_tokens[source_language]

# Generate the translation with beam search
translated_tokens = model_4bit.to(device).generate(
    **inputs,
    forced_bos_token_id=language_tokens[target_language],
    max_length=100,
    num_beams=5,
)

# Decode and print the translated result
result = tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)[0]
print(result)
# Expected output: "Eddwaliro liri ludda wa?"

Runs of Sunbird translate-nllb-1.3b-salt-4bit on huggingface.co

7
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About translate-nllb-1.3b-salt-4bit huggingface.co Model

translate-nllb-1.3b-salt-4bit huggingface.co

translate-nllb-1.3b-salt-4bit huggingface.co is an AI model on huggingface.co that provides translate-nllb-1.3b-salt-4bit's model effect (), which can be used instantly with this Sunbird translate-nllb-1.3b-salt-4bit model. huggingface.co supports a free trial of the translate-nllb-1.3b-salt-4bit model, and also provides paid use of the translate-nllb-1.3b-salt-4bit. Support call translate-nllb-1.3b-salt-4bit model through api, including Node.js, Python, http.

translate-nllb-1.3b-salt-4bit huggingface.co Url

https://huggingface.co/Sunbird/translate-nllb-1.3b-salt-4bit

Sunbird translate-nllb-1.3b-salt-4bit online free

translate-nllb-1.3b-salt-4bit huggingface.co is an online trial and call api platform, which integrates translate-nllb-1.3b-salt-4bit's modeling effects, including api services, and provides a free online trial of translate-nllb-1.3b-salt-4bit, you can try translate-nllb-1.3b-salt-4bit online for free by clicking the link below.

Sunbird translate-nllb-1.3b-salt-4bit online free url in huggingface.co:

https://huggingface.co/Sunbird/translate-nllb-1.3b-salt-4bit

translate-nllb-1.3b-salt-4bit install

translate-nllb-1.3b-salt-4bit is an open source model from GitHub that offers a free installation service, and any user can find translate-nllb-1.3b-salt-4bit on GitHub to install. At the same time, huggingface.co provides the effect of translate-nllb-1.3b-salt-4bit install, users can directly use translate-nllb-1.3b-salt-4bit installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

translate-nllb-1.3b-salt-4bit install url in huggingface.co:

https://huggingface.co/Sunbird/translate-nllb-1.3b-salt-4bit

Url of translate-nllb-1.3b-salt-4bit

translate-nllb-1.3b-salt-4bit huggingface.co Url

Provider of translate-nllb-1.3b-salt-4bit huggingface.co

Sunbird
ORGANIZATIONS

Other API from Sunbird

huggingface.co

Total runs: 3.3K
Run Growth: 2.0K
Growth Rate: 60.05%
Updated:October 09 2025
huggingface.co

Total runs: 2.1K
Run Growth: 321
Growth Rate: 15.29%
Updated:October 09 2025
huggingface.co

Total runs: 263
Run Growth: 0
Growth Rate: 0.00%
Updated:July 01 2024
huggingface.co

Total runs: 15
Run Growth: -13
Growth Rate: -86.67%
Updated:February 14 2025
huggingface.co

Total runs: 15
Run Growth: 9
Growth Rate: 60.00%
Updated:October 19 2023
huggingface.co

Total runs: 8
Run Growth: 0
Growth Rate: 0.00%
Updated:January 09 2023
huggingface.co

Total runs: 6
Run Growth: 2
Growth Rate: 28.57%
Updated:September 11 2023
huggingface.co

Total runs: 4
Run Growth: 0
Growth Rate: 0.00%
Updated:February 10 2023
huggingface.co

Total runs: 3
Run Growth: -1
Growth Rate: -33.33%
Updated:December 14 2023
huggingface.co

Total runs: 3
Run Growth: 0
Growth Rate: 0.00%
Updated:October 19 2023
huggingface.co

Total runs: 1
Run Growth: -43
Growth Rate: -4300.00%
Updated:October 19 2023
huggingface.co

Total runs: 1
Run Growth: 1
Growth Rate: 100.00%
Updated:February 10 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:February 08 2021