Edit model card

Model Card for Model ID

French-Alpaca based on microsoft/Phi-3-mini-4k-instruct
4k is the context length (in tokens)

image/jpeg

Model Description

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

Usage

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'])

Limitations

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.

  • Developed by: Jonathan Pacifico, 2024
  • Model type: LLM
  • Language(s) (NLP): French
  • License: MIT
Downloads last month
73
Safetensors
Model size
3.82B params
Tensor type
FP16
·
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Dataset used to train jpacifico/French-Alpaca-Phi-3-mini-4k-instruct-beta

Collection including jpacifico/French-Alpaca-Phi-3-mini-4k-instruct-beta