Instructions to use cosimoiaia/Loquace-Wizard-13B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cosimoiaia/Loquace-Wizard-13B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cosimoiaia/Loquace-Wizard-13B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cosimoiaia/Loquace-Wizard-13B") model = AutoModelForCausalLM.from_pretrained("cosimoiaia/Loquace-Wizard-13B") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use cosimoiaia/Loquace-Wizard-13B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cosimoiaia/Loquace-Wizard-13B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cosimoiaia/Loquace-Wizard-13B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/cosimoiaia/Loquace-Wizard-13B
- SGLang
How to use cosimoiaia/Loquace-Wizard-13B 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 "cosimoiaia/Loquace-Wizard-13B" \ --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": "cosimoiaia/Loquace-Wizard-13B", "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 "cosimoiaia/Loquace-Wizard-13B" \ --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": "cosimoiaia/Loquace-Wizard-13B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use cosimoiaia/Loquace-Wizard-13B with Docker Model Runner:
docker model run hf.co/cosimoiaia/Loquace-Wizard-13B
Model Card for Loquace-Wizard-13B
๐ฎ๐น Loquace-Wizard-13B v0.1 ๐ฎ๐น
Loquace is an Italian speaking, instruction finetuned, Large Language model. ๐ฎ๐น
Loquace-Wizard-14B's peculiar features:
- The First 13B Specifically finetuned in Italian.
- Is pretty good a following istructions in Italian.
- Responds well to prompt-engineering.
- Works well in a RAG (Retrival Augmented Generation) setup.
- It has been trained on a relatively raw dataset Loquace-102K using QLoRa and WizardLM-13B-Instruct as base.
- Training took only 8 hours on a 3090, costing a little more than 2 euro! On Genesis Cloud GPU.
- It is Truly Open Source: Model, Dataset and Code to replicate the results are completely released.
- Created in a garage in the south of Italy.
The Loquace Italian LLM models are created with the goal of democratizing AI and LLM in the Italian Landscape.
No more need for expensive GPU, large funding, Big Corporation or Ivory Tower Institution, just download the code and train on your dataset on your own PC (or a cheap and reliable cloud provider like Genesis Cloud )
Fine-tuning Instructions:
The related code can be found at: https://github.com/cosimoiaia/Loquace
Inference:
from transformers import LlamaForCausalLM, AutoTokenizer
def generate_prompt(instruction):
prompt = f"""### Instruction: {instruction}
### Response:
"""
return prompt
model_name = "."
model = LlamaForCausalLM.from_pretrained(
model_name,
device_map="auto",
torch_dtype=torch.bfloat16
)
model.config.use_cache = True
tokenizer = AutoTokenizer.from_pretrained(model_name, add_eos_token=False)
prompt = generate_prompt("Chi era Dante Alighieri?")
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, do_sample = True, num_beams = 2, top_k=50, top_p= 0.95, max_new_tokens=2046, early_stopping = True)
print(tokenizer.decode(outputs[0], skip_special_tokens=True).split("Response:")[1].strip())
Model Author:
Cosimo Iaia cosimo.iaia@gmail.com
- Downloads last month
- 10