Instructions to use swap-uniba/LLaMAntino-2-chat-13b-hf-ITA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use swap-uniba/LLaMAntino-2-chat-13b-hf-ITA with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="swap-uniba/LLaMAntino-2-chat-13b-hf-ITA")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("swap-uniba/LLaMAntino-2-chat-13b-hf-ITA") model = AutoModelForCausalLM.from_pretrained("swap-uniba/LLaMAntino-2-chat-13b-hf-ITA", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use swap-uniba/LLaMAntino-2-chat-13b-hf-ITA with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "swap-uniba/LLaMAntino-2-chat-13b-hf-ITA" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "swap-uniba/LLaMAntino-2-chat-13b-hf-ITA", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/swap-uniba/LLaMAntino-2-chat-13b-hf-ITA
- SGLang
How to use swap-uniba/LLaMAntino-2-chat-13b-hf-ITA 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 "swap-uniba/LLaMAntino-2-chat-13b-hf-ITA" \ --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": "swap-uniba/LLaMAntino-2-chat-13b-hf-ITA", "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 "swap-uniba/LLaMAntino-2-chat-13b-hf-ITA" \ --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": "swap-uniba/LLaMAntino-2-chat-13b-hf-ITA", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use swap-uniba/LLaMAntino-2-chat-13b-hf-ITA with Docker Model Runner:
docker model run hf.co/swap-uniba/LLaMAntino-2-chat-13b-hf-ITA
Model Card for LLaMAntino-2-chat-13b-ITA
Model description
LLaMAntino-2-chat-13b is a Large Language Model (LLM) that is an italian-adapted LLaMA 2 chat. This model aims to provide Italian NLP researchers with a base model for italian dialogue use cases.
The model was trained using QLora and using as training data clean_mc4_it medium. If you are interested in more details regarding the training procedure, you can find the code we used at the following link:
- Repository: https://github.com/swapUniba/LLaMAntino
NOTICE: the code has not been released yet, we apologize for the delay, it will be available asap!
- Developed by: Pierpaolo Basile, Elio Musacchio, Marco Polignano, Lucia Siciliani, Giuseppe Fiameni, Giovanni Semeraro
- Funded by: PNRR project FAIR - Future AI Research
- Compute infrastructure: Leonardo supercomputer
- Model type: LLaMA 2 chat
- Language(s) (NLP): Italian
- License: Llama 2 Community License
- Finetuned from model: NousResearch/Llama-2-13b-chat-hf
How to Get Started with the Model
Below you can find an example of model usage:
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "swap-uniba/LLaMAntino-2-chat-13b-hf-ITA"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
prompt = "Scrivi qui un possibile prompt"
input_ids = tokenizer(prompt, return_tensors="pt").input_ids
outputs = model.generate(input_ids=input_ids)
print(tokenizer.batch_decode(outputs.detach().cpu().numpy()[:, input_ids.shape[1]:], skip_special_tokens=True)[0])
If you are facing issues when loading the model, you can try to load it quantized:
model = AutoModelForCausalLM.from_pretrained(model_id, load_in_8bit=True)
Note: The model loading strategy above requires the bitsandbytes and accelerate libraries
Citation
If you use this model in your research, please cite the following:
@misc{basile2023llamantino,
title={LLaMAntino: LLaMA 2 Models for Effective Text Generation in Italian Language},
author={Pierpaolo Basile and Elio Musacchio and Marco Polignano and Lucia Siciliani and Giuseppe Fiameni and Giovanni Semeraro},
year={2023},
eprint={2312.09993},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
- Downloads last month
- 12