Instructions to use avans06/ALMA-13B-ct2-int8_float16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use avans06/ALMA-13B-ct2-int8_float16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="avans06/ALMA-13B-ct2-int8_float16")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("avans06/ALMA-13B-ct2-int8_float16", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use avans06/ALMA-13B-ct2-int8_float16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "avans06/ALMA-13B-ct2-int8_float16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "avans06/ALMA-13B-ct2-int8_float16", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/avans06/ALMA-13B-ct2-int8_float16
- SGLang
How to use avans06/ALMA-13B-ct2-int8_float16 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 "avans06/ALMA-13B-ct2-int8_float16" \ --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": "avans06/ALMA-13B-ct2-int8_float16", "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 "avans06/ALMA-13B-ct2-int8_float16" \ --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": "avans06/ALMA-13B-ct2-int8_float16", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use avans06/ALMA-13B-ct2-int8_float16 with Docker Model Runner:
docker model run hf.co/avans06/ALMA-13B-ct2-int8_float16
ALMA-13B model for CTranslate2
The model is quantized version of the haoranxu/ALMA-13B with int8_float16 quantization and can be used in CTranslate2.
ALMA (Advanced Language Model-based trAnslator) is an LLM-based translation model, which adopts a new translation model paradigm: it begins with fine-tuning on monolingual data and is further optimized using high-quality parallel data. This two-step fine-tuning process ensures strong translation performance.
Conversion details
The original model was converted on 2023-12 with the following command:
ct2-transformers-converter --model haoranxu/ALMA-13B --quantization int8_float16 --output_dir ALMA-13B-ct2-int8_float16 \
--copy_files generation_config.json special_tokens_map.json tokenizer.model tokenizer_config.json
Prompt template: ALMA
Translate this from English to Chinese:
English: {prompt}
Chinese:
Example
This example code is obtained from CTranslate2_transformers.
More detailed information about the generate_batch methon can be found at CTranslate2_Generator.generate_batch.
import ctranslate2
import transformers
generator = ctranslate2.Generator("avans06/ALMA-13B-ct2-int8_float16")
tokenizer = transformers.AutoTokenizer.from_pretrained("haoranxu/ALMA-13B")
text = "Who is Alan Turing?"
prompt = f"Translate this from English to Chinese:\nEnglish: {text}\nChinese:"
tokens = tokenizer.convert_ids_to_tokens(tokenizer.encode(prompt))
results = generator.generate_batch([tokens], max_length=256, sampling_temperature=0.7, sampling_topp=0.9, repetition_penalty=1.1, include_prompt_in_result=False)
output = tokenizer.decode(results[0].sequences_ids[0])
The following explanations are excerpted from the FAQ section of the author's GitHub README.
- What language directions do ALMA support?
Currently, ALMA supports 10 directions: English↔German, Englishs↔Czech, Englishs↔Icelandic, Englishs↔Chinese, Englishs↔Russian. However, it may surprise us in other directions :)
More information
For more information about the original model, see its GitHub repository
- Downloads last month
- 2