jpacifico/French-Alpaca-dataset-Instruct-110K
Viewer • Updated • 110k • 294 • 14
How to use AdrienB134/French-Alpaca-Croissant-1.3B-Instruct with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="AdrienB134/French-Alpaca-Croissant-1.3B-Instruct") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("AdrienB134/French-Alpaca-Croissant-1.3B-Instruct")
model = AutoModelForCausalLM.from_pretrained("AdrienB134/French-Alpaca-Croissant-1.3B-Instruct")How to use AdrienB134/French-Alpaca-Croissant-1.3B-Instruct with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "AdrienB134/French-Alpaca-Croissant-1.3B-Instruct"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "AdrienB134/French-Alpaca-Croissant-1.3B-Instruct",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/AdrienB134/French-Alpaca-Croissant-1.3B-Instruct
How to use AdrienB134/French-Alpaca-Croissant-1.3B-Instruct with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "AdrienB134/French-Alpaca-Croissant-1.3B-Instruct" \
--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": "AdrienB134/French-Alpaca-Croissant-1.3B-Instruct",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "AdrienB134/French-Alpaca-Croissant-1.3B-Instruct" \
--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": "AdrienB134/French-Alpaca-Croissant-1.3B-Instruct",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use AdrienB134/French-Alpaca-Croissant-1.3B-Instruct with Unsloth Studio:
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 AdrienB134/French-Alpaca-Croissant-1.3B-Instruct to start chatting
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 AdrienB134/French-Alpaca-Croissant-1.3B-Instruct to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for AdrienB134/French-Alpaca-Croissant-1.3B-Instruct to start chatting
pip install unsloth
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name="AdrienB134/French-Alpaca-Croissant-1.3B-Instruct",
max_seq_length=2048,
)How to use AdrienB134/French-Alpaca-Croissant-1.3B-Instruct with Docker Model Runner:
docker model run hf.co/AdrienB134/French-Alpaca-Croissant-1.3B-Instruct
from transformers import TextStreamer
from unsloth import FastLanguageModel
import torch
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "AdrienB134/French-Alpaca-Croissant-1.3B-Instruct",
max_seq_length = 4096,
dtype = None,
load_in_4bit = True,
fix_tokenizer = False,
)
alpaca_prompt = """Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
{}
### Input:
{}
### Response:
{}"""
FastLanguageModel.for_inference(model)
inputs = tokenizer(
[
alpaca_prompt.format(
"Continue la suite de Fibonnaci", # instruction
"1, 1, 2, 3, 5, 8", # input
"", # output - leave this blank for generation!
)
], return_tensors = "pt").to("cuda")
text_streamer = TextStreamer(tokenizer)
_ = model.generate(**inputs, streamer = text_streamer, max_new_tokens = 128)
This llama model was trained 2x faster with Unsloth and Huggingface's TRL library.
Base model
croissantllm/CroissantLLMBase