Text Generation
Transformers
PyTorch
French
llama
LLM
llama-2
finetuned
conversational
text-generation-inference
Instructions to use bofenghuang/vigogne-2-7b-chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bofenghuang/vigogne-2-7b-chat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="bofenghuang/vigogne-2-7b-chat") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("bofenghuang/vigogne-2-7b-chat") model = AutoModelForCausalLM.from_pretrained("bofenghuang/vigogne-2-7b-chat", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use bofenghuang/vigogne-2-7b-chat with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "bofenghuang/vigogne-2-7b-chat" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bofenghuang/vigogne-2-7b-chat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/bofenghuang/vigogne-2-7b-chat
- SGLang
How to use bofenghuang/vigogne-2-7b-chat 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 "bofenghuang/vigogne-2-7b-chat" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bofenghuang/vigogne-2-7b-chat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "bofenghuang/vigogne-2-7b-chat" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bofenghuang/vigogne-2-7b-chat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use bofenghuang/vigogne-2-7b-chat with Docker Model Runner:
docker model run hf.co/bofenghuang/vigogne-2-7b-chat
Merge branch 'v2.0' into main
Browse files- README.md +3 -3
- tokenizer_config.json +1 -1
README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
| 1 |
---
|
|
|
|
| 2 |
language: fr
|
| 3 |
pipeline_tag: text-generation
|
| 4 |
inference: false
|
| 5 |
tags:
|
| 6 |
- LLM
|
| 7 |
-
- finetuned
|
| 8 |
-
- llama
|
| 9 |
- llama-2
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
<p align="center" width="100%">
|
|
@@ -53,7 +53,7 @@ print(tokenizer.apply_chat_template(conversation, tokenize=False, add_generation
|
|
| 53 |
You will get
|
| 54 |
|
| 55 |
```
|
| 56 |
-
<s><|system|>: Vous êtes
|
| 57 |
<|user|>: Bonjour ! Comment ça va aujourd'hui ?
|
| 58 |
<|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>
|
| 59 |
<|user|>: Quelle est la hauteur de la Tour Eiffel ?
|
|
|
|
| 1 |
---
|
| 2 |
+
license: llama2
|
| 3 |
language: fr
|
| 4 |
pipeline_tag: text-generation
|
| 5 |
inference: false
|
| 6 |
tags:
|
| 7 |
- LLM
|
|
|
|
|
|
|
| 8 |
- llama-2
|
| 9 |
+
- finetuned
|
| 10 |
---
|
| 11 |
|
| 12 |
<p align="center" width="100%">
|
|
|
|
| 53 |
You will get
|
| 54 |
|
| 55 |
```
|
| 56 |
+
<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.
|
| 57 |
<|user|>: Bonjour ! Comment ça va aujourd'hui ?
|
| 58 |
<|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>
|
| 59 |
<|user|>: Quelle est la hauteur de la Tour Eiffel ?
|
tokenizer_config.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
| 19 |
"single_word": false
|
| 20 |
},
|
| 21 |
"legacy": false,
|
| 22 |
-
"chat_template": "{{ bos_token }}{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% elif true == true %}{% set loop_messages = messages %}{% set system_message = 'Vous êtes
|
| 23 |
"model_max_length": 1000000000000000019884624838656,
|
| 24 |
"pad_token": null,
|
| 25 |
"padding_side": "right",
|
|
|
|
| 19 |
"single_word": false
|
| 20 |
},
|
| 21 |
"legacy": false,
|
| 22 |
+
"chat_template": "{{ bos_token }}{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% elif true == true %}{% set loop_messages = messages %}{% set system_message = 'Vous êtes Vigogne, un assistant IA créé par Zaion Lab. Vous suivez extrêmement bien les instructions. Aidez autant que vous le pouvez.' %}{% else %}{% set loop_messages = messages %}{% set system_message = false %}{% endif %}{% if system_message != false %}{{ '<|system|>: ' + system_message + '\\n' }}{% endif %}{% for message in loop_messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if message['role'] == 'user' %}{{ '<|user|>: ' + message['content'].strip() + '\\n' }}{% elif message['role'] == 'assistant' %}{{ '<|assistant|>: ' + message['content'].strip() + eos_token + '\\n' }}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<|assistant|>:' }}{% endif %}",
|
| 23 |
"model_max_length": 1000000000000000019884624838656,
|
| 24 |
"pad_token": null,
|
| 25 |
"padding_side": "right",
|