Instructions to use croissantllm/CroissantLLMBase with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use croissantllm/CroissantLLMBase with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="croissantllm/CroissantLLMBase")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("croissantllm/CroissantLLMBase") model = AutoModelForCausalLM.from_pretrained("croissantllm/CroissantLLMBase") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use croissantllm/CroissantLLMBase with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "croissantllm/CroissantLLMBase" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "croissantllm/CroissantLLMBase", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/croissantllm/CroissantLLMBase
- SGLang
How to use croissantllm/CroissantLLMBase 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 "croissantllm/CroissantLLMBase" \ --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": "croissantllm/CroissantLLMBase", "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 "croissantllm/CroissantLLMBase" \ --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": "croissantllm/CroissantLLMBase", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use croissantllm/CroissantLLMBase with Docker Model Runner:
docker model run hf.co/croissantllm/CroissantLLMBase
Missing tokenizer.model
Hello,
Congrats and thanks for sharing CroissantLLM :)
We noticed that "tokenizer.model" file is missing, which can cause issues in some workflows.
See for instance https://github.com/huggingface/transformers/issues/29137
Hello !
I think we really only ever kept the fast version of the tokenizer (use_fast = True) and never had to rely on the original sentencepiece tokenizer.model standard...
This is similar as what is done in https://huggingface.co/meta-llama/Meta-Llama-3-8B/.
I don't have any more files than you sadly...
https://github.com/huggingface/transformers/issues/21289
Did you manage to solve this on your end ?
Testing CroissantLLM with slow encoder was a one-off need.
I just mentioned the possible error here, in case it was unintentional.
But I think it's fine like this. There's no real practical use for the slow tokenizer (instead of the fast one).
Thank you !