Downloads · 30 days
0
aminLo/run-v2-02052025-llama-3B
run-v2-02052025-llama-3B is a machine learning model from aminLo. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This is a fine-tuned Llama 3.2 model for administrative text information extraction.
Downloads · 30 days
0
Access
Public
Updated May 2, 2025
Repo size
115 MB
Likes
0
Public
Click a slice to open those files.
.safetensors97.3 MB · 85%
From the Hugging Face model README
This is a fine-tuned Llama 3.2 model for administrative text information extraction.
from transformers import pipeline, AutoTokenizer
from unsloth import FastLanguageModel
# Load model
model, tokenizer = FastLanguageModel.from_pretrained(
"aminLo/run-v2-02052025-llama-3B",
max_seq_length=2048,
load_in_4bit=True,
)
# Format prompt
instruction = """
Tu es un assistant chargé d'extraire des informations clés depuis un texte administratif.
Analyse le texte suivant et retourne les informations au format JSON.
"""
input_text = """
[Your administrative text here]
"""
# Create pipeline
pipe = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
max_new_tokens=512,
temperature=0.1,
)
# Format as chat
messages = [
{"role": "user", "content": f"
Tu es un assistant chargé d'extraire des informations clés depuis un texte administratif.
Analyse le texte suivant et retourne les informations au format JSON en respectant la structure suivante :
1. Si l'événement est un **avancement d'échelon** :
{
"Agent": "NOM PRÉNOM",
"Etablissement": "Ville ou organisme concerné",
"Evenement": "avancement d'échelon",
"Echelon": "Numéro d'échelon",
"Date": "AAAA-MM-JJ"
}
2. Si l'événement est un **passage à temps partiel** (y compris thérapeutique ou sous autorisation) :
{
"Agent": "NOM PRÉNOM",
"Etablissement": "Ville ou organisme concerné",
"Evenement": "passage à temps partiel",
"TempsHebdomadaire": "Nombre d'heures/semaine",
"Pourcentage": "XX%",
"Durée": "Durée si précisée",
"Date": "AAAA-MM-JJ"
}
3. Pour les autres événements (nomination, fin de contrat, etc.) :
{
"Agent": "NOM PRÉNOM",
"Etablissement": "Ville ou organisme concerné",
"Evenement": "type d'événement",
"Date": "AAAA-MM-JJ",
"Durée": "si précisée"
}
Texte à analyser :
\n\n'input_text'"}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
# Generate response
output = pipe(prompt, return_full_text=False)
generated_text = outputs[0]['generated_text']
print(generated_text)