Instructions to use OpenLLM-France/Lucie-7B-Instruct-human-data with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use OpenLLM-France/Lucie-7B-Instruct-human-data with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="OpenLLM-France/Lucie-7B-Instruct-human-data", filename="Lucie-7B-Instruct-human-data-q4_k_m.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use OpenLLM-France/Lucie-7B-Instruct-human-data with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf OpenLLM-France/Lucie-7B-Instruct-human-data:Q4_K_M # Run inference directly in the terminal: llama-cli -hf OpenLLM-France/Lucie-7B-Instruct-human-data:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf OpenLLM-France/Lucie-7B-Instruct-human-data:Q4_K_M # Run inference directly in the terminal: llama-cli -hf OpenLLM-France/Lucie-7B-Instruct-human-data: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 OpenLLM-France/Lucie-7B-Instruct-human-data:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf OpenLLM-France/Lucie-7B-Instruct-human-data: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 OpenLLM-France/Lucie-7B-Instruct-human-data:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf OpenLLM-France/Lucie-7B-Instruct-human-data:Q4_K_M
Use Docker
docker model run hf.co/OpenLLM-France/Lucie-7B-Instruct-human-data:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use OpenLLM-France/Lucie-7B-Instruct-human-data with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenLLM-France/Lucie-7B-Instruct-human-data" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenLLM-France/Lucie-7B-Instruct-human-data", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/OpenLLM-France/Lucie-7B-Instruct-human-data:Q4_K_M
- Ollama
How to use OpenLLM-France/Lucie-7B-Instruct-human-data with Ollama:
ollama run hf.co/OpenLLM-France/Lucie-7B-Instruct-human-data:Q4_K_M
- Unsloth Studio
How to use OpenLLM-France/Lucie-7B-Instruct-human-data with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for OpenLLM-France/Lucie-7B-Instruct-human-data to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for OpenLLM-France/Lucie-7B-Instruct-human-data to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for OpenLLM-France/Lucie-7B-Instruct-human-data to start chatting
- Docker Model Runner
How to use OpenLLM-France/Lucie-7B-Instruct-human-data with Docker Model Runner:
docker model run hf.co/OpenLLM-France/Lucie-7B-Instruct-human-data:Q4_K_M
- Lemonade
How to use OpenLLM-France/Lucie-7B-Instruct-human-data with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull OpenLLM-France/Lucie-7B-Instruct-human-data:Q4_K_M
Run and chat with the model
lemonade run user.Lucie-7B-Instruct-human-data-Q4_K_M
List all available models
lemonade list
license: apache-2.0
datasets:
- CohereForAI/aya_dataset
- argilla/databricks-dolly-15k-curated-multilingual
- Gael540/dataSet_ens_sup_fr-v1
- ai2-adapt-dev/flan_v2_converted
- OpenAssistant/oasst1
language:
- fr
- en
- de
- it
- es
base_model:
- OpenLLM-France/Lucie-7B
pipeline_tag: text-generation
Model Card for Lucie-7B-Instruct-human-data
Model Description
Lucie-7B-Instruct-human-data is a fine-tuned version of Lucie-7B, an open-source, multilingual causal language model created by OpenLLM-France.
Lucie-7B-Instruct-human-data is fine-tuned on human-produced instructions collected either from open annotation campaigns or by applying templates to extant datasets. The performance of Lucie-7B-Instruct-human-data falls below that of Lucie-7B-Instruct; the interest of the model is to show what can be done to fine-tune LLMs to follow instructions without appealing to third party LLMs.
Training details
Training data
Lucie-7B-Instruct-human-data is trained on the following datasets published by third parties:
- Aya Dataset (English, 3944 samples; French, 1422; German, 241; Italian, 738; Spanish, 3854)
- Dolly (English, French, German, Spanish; 15015 x 4 samples)
- ENS (French, 394 samples)
- FLAN v2 Converted (English, 78580 samples)
- Open Assistant 1 (English, 21151 samples; French, 1223; German, 1515; Italian, 370; Spanish, 14078)
- Oracle (French, 4613 samples)
- PIAF (French, 1849 samples)
And the following datasets developed for the Lucie instruct models:
- Croissant Aligned Instruct (French-English, 20K examples sampled randomly from 80K total)
- Hard-coded prompts concerning OpenLLM and Lucie (based on allenai/tulu-3-hard-coded-10x)
- French: openllm_french.jsonl (24x10 samples)
- English: openllm_english.jsonl (24x10 samples)
Preprocessing
- Filtering by language: Aya Dataset, Dolly and Open Assistant were filtered to keep only English and French samples, respectively.
- Filtering by keyword: Examples containing assistant responses were filtered out from Open Assistant if the responses contained a keyword from the list filter_strings. This filter is designed to remove examples in which the assistant is presented as model other than Lucie (e.g., ChatGPT, Gemma, Llama, ...).
- Duplicate examples were removed from Open Assistant.
Training procedure
The model architecture and hyperparameters are the same as for Lucie-7B during the annealing phase with the following exceptions:
- context length: 4096
- batch size: 1024
- max learning rate: 3e-5
- min learning rate: 3e-6
Testing the model
Test in python
- test_transformers_gguf.py: Test GGUF model with
transformerspackage (WARNING: loading the model is long)
Test with ollama
- Download and install Ollama
- Download the GGUF model
- Copy the
Modelfile, adpating if necessary the path to the GGUF file (line starting withFROM). - Run in a shell:
ollama create -f Modelfile Lucieollama run Lucie
- Once ">>>" appears, type your prompt(s) and press Enter.
- Optionally, restart a conversation by typing "
/clear" - End the session by typing "
/bye".
Useful for debug:
- How to print input requests and output responses in Ollama server?
- Documentation on Modelfile
- Examples: Ollama model library
- Llama 3 example: https://ollama.com/library/llama3.1
- Examples: Ollama model library
- Add GUI : https://docs.openwebui.com/
Test with vLLM
1. Run vLLM Docker Container
Use the following command to deploy the model,
replacing INSERT_YOUR_HF_TOKEN with your Hugging Face Hub token.
docker run --runtime nvidia --gpus=all \
--env "HUGGING_FACE_HUB_TOKEN=INSERT_YOUR_HF_TOKEN" \
-p 8000:8000 \
--ipc=host \
vllm/vllm-openai:latest \
--model OpenLLM-France/Lucie-7B-Instruct-v1
2. Test using OpenAI Client in Python
To test the deployed model, use the OpenAI Python client as follows:
from openai import OpenAI
# Initialize the client
client = OpenAI(base_url='http://localhost:8000/v1', api_key='empty')
# Define the input content
content = "Hello Lucie"
# Generate a response
chat_response = client.chat.completions.create(
model="OpenLLM-France/Lucie-7B-Instruct-v1",
messages=[
{"role": "user", "content": content}
],
)
print(chat_response.choices[0].message.content)
Citation
Coming soon.
Acknowledgements
This work was performed using HPC resources from GENCI–IDRIS (Grant 2024-GC011015444).
Lucie-7B was created by members of LINAGORA and the OpenLLM-France community, including in alphabetical order: Olivier Gouvert (LINAGORA), Ismaïl Harrando (LINAGORA/SciencesPo), Julie Hunter (LINAGORA), Jean-Pierre Lorré (LINAGORA), Jérôme Louradour (LINAGORA), Michel-Marie Maudet (LINAGORA), and Laura Rivière (LINAGORA).
We thank Clément Bénesse (Opsci), Christophe Cerisara (LORIA), Evan Dufraisse (CEA), Guokan Shang (MBZUAI), Joël Gombin (Opsci), Jordan Ricker (Opsci), and Olivier Ferret (CEA) for their helpful input.