Instructions to use BSC-LT/ALIA-40b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BSC-LT/ALIA-40b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BSC-LT/ALIA-40b")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("BSC-LT/ALIA-40b") model = AutoModelForCausalLM.from_pretrained("BSC-LT/ALIA-40b") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use BSC-LT/ALIA-40b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BSC-LT/ALIA-40b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BSC-LT/ALIA-40b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/BSC-LT/ALIA-40b
- SGLang
How to use BSC-LT/ALIA-40b 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 "BSC-LT/ALIA-40b" \ --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": "BSC-LT/ALIA-40b", "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 "BSC-LT/ALIA-40b" \ --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": "BSC-LT/ALIA-40b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use BSC-LT/ALIA-40b with Docker Model Runner:
docker model run hf.co/BSC-LT/ALIA-40b
funcionar funciona
Lo que no tengo claro es si son muchos o pocos tokens por segundo, los que da el vLLM. Supongo que es por ser de pocas frases el ejemplo.
con 4*h100 saca 134 t/s
Processed prompts: 100%|βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 5/5 [00:00<00:00, 5.36it/s, est. speed input: 64.35 toks/s, output: 134.06 toks/s]Prompt: 'Las fiestas de San Isidro Labrador de Yecla son', Generated text: ' unas celebraciones que se celebran en la localidad espaΓ±ola de Yecla, Murcia. Se trata del patrΓ³n de esta ciudad y'Prompt: 'El punt mΓ©s alt del Parc Natural del Montseny Γ©s', Generated text: " el TurΓ³ de lβHome, amb 1.706 metres d'altitud sobre la serra de Collform"Prompt: 'Sentence in English: The typical chance of such a storm is around 10%. Sentence in Catalan:', Generated text: " La probabilitat tΓpica d'una tempesta com aquesta Γ©s al voltant del 10%\nSentence in Spanish:"Prompt: 'Si le monde Γ©tait clair', Generated text: ", il nβy aurait pas dβart. Β» (Oscar Wilde)\nΒ« L'artiste est celui qui sait"Prompt: 'The future of AI is', Generated text: ' bright, and itβs only going to get brighter. With the advent of artificial intelligence (AI), we are seeing'INFO 01-20 20:10:05 multiproc_worker_utils.py:127] Killing local vLLM worker processes
y en 4*L40S un poco menos, pero no mucho menos, 102 tokens/segundo
:Processed prompts: 100%|βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 5/5 [00:01<00:00, 4.09it/s, est. speed input: 49.09 toks/s, output: 102.28 toks/s]Prompt: 'Las fiestas de San Isidro Labrador de Yecla son', Generated text: ' unas celebraciones que se celebran en la localidad espaΓ±ola de Yecla, Murcia. Se trata del patrΓ³n de esta ciudad y'Prompt: 'El punt mΓ©s alt del Parc Natural del Montseny Γ©s', Generated text: " el TurΓ³ de lβHome, amb 1.706 metres d'altitud sobre la serra de Collform"Prompt: 'Sentence in English: The typical chance of such a storm is around 10%. Sentence in Catalan:', Generated text: " La probabilitat tΓpica d'una tempesta com aquesta Γ©s al voltant del 10%.\nSentence in Spanish:"Prompt: 'Si le monde Γ©tait clair', Generated text: ", il nβy aurait pas dβart. Β» (Oscar Wilde)\nLorsque l'on parle de"Prompt: 'The future of AI is', Generated text: ' bright, and itβs only going to get brighter. With the advent of artificial intelligence (AI), we are seeing'ERROR 01-20 20:19:14 multiproc_worker_utils.py:123] Worker VllmWorkerProcess pid 3545108 died, exit code: -15
un mosqueo de vLLM es que debe emplear otra libreria distinta para conectarse a huggingface, asi que hay que ir probando las recetas de https://stackoverflow.com/questions/71692354/facing-ssl-error-with-huggingface-pretrained-models hasta que vez cual funciona para que chute el https.
Hola, yo lo estoy probando con maquina virtual vmware fusion sobre imac, y si no le asigno 500 GB al disco, no va. Ahora con Kali Linux no va porque, supongo, el tmp solo tiene 1Gb y no le alcanza, asi que nada, ubuntu via vmware y va bien hasta que instalo las librerias en virtualenv de python. ya cuando compile te dire porque ahi se pone a bajar tensor 17 o 18 unidades de 6 o 7 GB cada uno y eso necesita "algo" de espacio. Este mac tiene bastantes GB ram pero no lo veo en uno con 4 GB u 8 GB. asi que no sera algo que pueda instalar mucha gente, supongo