Downloads · 30 days
61
7% of all-time downloads
jpacifico/French-Alpaca-Phi-3-mini-4k-instruct-beta
French-Alpaca-Phi-3-mini-4k-instruct-beta is a text generation model from jpacifico. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
French-Alpaca based on microsoft/Phi-3-mini-4k-instruct 4k is the context length (in tokens)
Downloads · 30 days
61
7% of all-time downloads
All-time downloads
814
Public
Parameters
3.8B
7.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors7.6 GB · 100%
From the Hugging Face model README
French-Alpaca based on microsoft/Phi-3-mini-4k-instruct
4k is the context length (in tokens)

fine-tuned from the original French-Alpaca-dataset entirely generated with OpenAI GPT-3.5-turbo.
French-Alpaca is a general model and can itself be finetuned to be specialized for specific use cases.
The fine-tuning method is inspired from https://crfm.stanford.edu/2023/03/13/alpaca.html
Quantized GGUF version : coming soon
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
torch.random.manual_seed(0)
model = AutoModelForCausalLM.from_pretrained(
"microsoft/Phi-3-mini-4k-instruct",
device_map="cuda",
torch_dtype="auto",
trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained("jpacifico/French-Alpaca-Phi-3-mini-4k-instruct-v1.0")
messages = [
{"role": "system", "content": "Vous êtes un assistant numérique serviable. Veuillez fournir des informations sûres, éthiques et précises à l'utilisateur."},
{"role": "user", "content": "Pouvez-vous fournir des façons de manger des combinaisons de bananes et de fruits du dragon ?"},
{"role": "assistant", "content": "Bien sûr ! Voici quelques façons de manger des bananes et des fruits du dragon ensemble : 1. Smoothie à la banane et au fruit du dragon : mixez des bananes et des fruits du dragon avec un peu de lait et de miel. 2. Salade de banane et de fruit du dragon : mélangez des bananes tranchées et des fruits du dragon avec un peu de jus de citron et de miel."},
{"role": "user", "content": "Et pour résoudre une équation 2x + 3 = 7 ?"},
]
pipe = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
)
generation_args = {
"max_new_tokens": 500,
"return_full_text": False,
"temperature": 0.0,
"do_sample": False,
}
output = pipe(messages, **generation_args)
print(output[0]['generated_text'])
The French-Alpaca model is a quick demonstration that a 3B base model can be easily fine-tuned to specialize in a particular language. It does not have any moderation mechanisms.