Instructions to use cmh/vigogne-2-13b-chat-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use cmh/vigogne-2-13b-chat-gguf with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf cmh/vigogne-2-13b-chat-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf cmh/vigogne-2-13b-chat-gguf:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf cmh/vigogne-2-13b-chat-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf cmh/vigogne-2-13b-chat-gguf:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf cmh/vigogne-2-13b-chat-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf cmh/vigogne-2-13b-chat-gguf:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf cmh/vigogne-2-13b-chat-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf cmh/vigogne-2-13b-chat-gguf:Q4_K_M
Use Docker
docker model run hf.co/cmh/vigogne-2-13b-chat-gguf:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use cmh/vigogne-2-13b-chat-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cmh/vigogne-2-13b-chat-gguf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cmh/vigogne-2-13b-chat-gguf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/cmh/vigogne-2-13b-chat-gguf:Q4_K_M
- Ollama
How to use cmh/vigogne-2-13b-chat-gguf with Ollama:
ollama run hf.co/cmh/vigogne-2-13b-chat-gguf:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use cmh/vigogne-2-13b-chat-gguf with Docker Model Runner:
docker model run hf.co/cmh/vigogne-2-13b-chat-gguf:Q4_K_M
- Lemonade
How to use cmh/vigogne-2-13b-chat-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull cmh/vigogne-2-13b-chat-gguf:Q4_K_M
Run and chat with the model
lemonade run user.vigogne-2-13b-chat-gguf-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Vigogne 2 13B Chat - GGUF
This repo contains GGUF format model files for bofenghuang's Vigogne 2 13B Chat.
Vigogne-2-13B-Chat: A Llama-2-based French Chat LLM
Vigogne-2-13B-Chat is a French chat LLM, based on LLaMA-2-13B, optimized to generate helpful and coherent responses in conversations with users.
Check out our release blog and GitHub repository for more information.
Usage and License Notices: Vigogne-2-13B-Chat follows Llama-2's usage policy. A significant portion of the training data is distilled from GPT-3.5-Turbo and GPT-4, kindly use it cautiously to avoid any violations of OpenAI's terms of use.
Prompt Template
We utilized prefix tokens <user>: and <assistant>: to distinguish between user and assistant utterances.
You can apply this formatting using the chat template through the apply_chat_template() method.
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("bofenghuang/vigogne-2-13b-chat")
conversation = [
{"role": "user", "content": "Bonjour ! Comment ça va aujourd'hui ?"},
{"role": "assistant", "content": "Bonjour ! Je suis une IA, donc je n'ai pas de sentiments, mais je suis prêt à vous aider. Comment puis-je vous assister aujourd'hui ?"},
{"role": "user", "content": "Quelle est la hauteur de la Tour Eiffel ?"},
{"role": "assistant", "content": "La Tour Eiffel mesure environ 330 mètres de hauteur."},
{"role": "user", "content": "Comment monter en haut ?"},
]
print(tokenizer.apply_chat_template(conversation, tokenize=False, add_generation_prompt=True))
You will get
<s><|system|>: Vous êtes Vigogne, un assistant IA créé par Zaion Lab. Vous suivez extrêmement bien les instructions. Aidez autant que vous le pouvez.
<|user|>: Bonjour ! Comment ça va aujourd'hui ?
<|assistant|>: Bonjour ! Je suis une IA, donc je n'ai pas de sentiments, mais je suis prêt à vous aider. Comment puis-je vous assister aujourd'hui ?</s>
<|user|>: Quelle est la hauteur de la Tour Eiffel ?
<|assistant|>: La Tour Eiffel mesure environ 330 mètres de hauteur.</s>
<|user|>: Comment monter en haut ?
<|assistant|>:
Usage
Inference using the unquantized model with 🤗 Transformers
from typing import Dict, List, Optional
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, GenerationConfig, TextStreamer
model_name_or_path = "bofenghuang/vigogne-2-13b-chat"
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, padding_side="right", use_fast=False)
model = AutoModelForCausalLM.from_pretrained(model_name_or_path, torch_dtype=torch.float16, device_map="auto")
streamer = TextStreamer(tokenizer, timeout=10.0, skip_prompt=True, skip_special_tokens=True)
def chat(
query: str,
history: Optional[List[Dict]] = None,
temperature: float = 0.7,
top_p: float = 1.0,
top_k: float = 0,
repetition_penalty: float = 1.1,
max_new_tokens: int = 1024,
**kwargs,
):
if history is None:
history = []
history.append({"role": "user", "content": query})
input_ids = tokenizer.apply_chat_template(history, add_generation_prompt=True, return_tensors="pt").to(model.device)
input_length = input_ids.shape[1]
generated_outputs = model.generate(
input_ids=input_ids,
generation_config=GenerationConfig(
temperature=temperature,
do_sample=temperature > 0.0,
top_p=top_p,
top_k=top_k,
repetition_penalty=repetition_penalty,
max_new_tokens=max_new_tokens,
pad_token_id=tokenizer.eos_token_id,
**kwargs,
),
streamer=streamer,
return_dict_in_generate=True,
)
generated_tokens = generated_outputs.sequences[0, input_length:]
generated_text = tokenizer.decode(generated_tokens, skip_special_tokens=True)
history.append({"role": "assistant", "content": generated_text})
return generated_text, history
# 1st round
response, history = chat("Un escargot parcourt 100 mètres en 5 heures. Quelle est sa vitesse ?", history=None)
# 2nd round
response, history = chat("Quand il peut dépasser le lapin ?", history=history)
# 3rd round
response, history = chat("Écris une histoire imaginative qui met en scène une compétition de course entre un escargot et un lapin.", history=history)
You can also use the Google Colab Notebook provided below.
Inference using the unquantized model with vLLM
Set up an OpenAI-compatible server with the following command:
# Install vLLM
# This may take 5-10 minutes.
# pip install vllm
# Start server for Vigogne-Chat models
python -m vllm.entrypoints.openai.api_server --model bofenghuang/vigogne-2-13b-chat
# List models
# curl http://localhost:8000/v1/models
Query the model using the openai python package.
import openai
# Modify OpenAI's API key and API base to use vLLM's API server.
openai.api_key = "EMPTY"
openai.api_base = "http://localhost:8000/v1"
# First model
models = openai.Model.list()
model = models["data"][0]["id"]
# Chat completion API
chat_completion = openai.ChatCompletion.create(
model=model,
messages=[
{"role": "user", "content": "Parle-moi de toi-même."},
],
max_tokens=1024,
temperature=0.7,
)
print("Chat completion results:", chat_completion)
Limitations
Vigogne is still under development, and there are many limitations that have to be addressed. Please note that it is possible that the model generates harmful or biased content, incorrect information or generally unhelpful answers.
- Downloads last month
- 100
3-bit
4-bit
5-bit
6-bit
8-bit
16-bit