olafdil/French_MultiSpeaker_Diarization
Viewer • Updated • 24 • 13 • 1
How to use olafdil/FrDiarization-Llama-3.1-8B-4bit 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 olafdil/FrDiarization-Llama-3.1-8B-4bit 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 olafdil/FrDiarization-Llama-3.1-8B-4bit to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for olafdil/FrDiarization-Llama-3.1-8B-4bit to start chatting
pip install unsloth
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name="olafdil/FrDiarization-Llama-3.1-8B-4bit",
max_seq_length=2048,
)This is a fine-tuned version of the Meta-Llama-3.1-8B-Instruct-bnb-4bit model, adapted for French multi-speaker diarization tasks. Below, you'll find details about the fine-tuning process, dataset, and how to use this model.
q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj.1616The model was fine-tuned on the French_MultiSpeaker_Diarization dataset, hosted on the Hugging Face Hub:
120,0000nonellama-3.1 template).Model Loading:
FastLanguageModel.from_pretrained().Dataset Preparation:
unsloth.chat_templates library.apply_chat_template() to suit the diarization task.Fine-Tuning:
You can load this model directly from Hugging Face:
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "olafdil/FrDiarization-Llama-3.1-8B-4bit"
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype="auto")
tokenizer = AutoTokenizer.from_pretrained(model_name)
template = """
I have an audio transcription where multiple speakers are involved in a conversation.
Your task is to distinguish the different speakers and diarize the text accordingly.
Each speaker's dialogue should be clearly labeled, such as 'Speaker 1:', 'Speaker 2:', etc.
Ensure that the labels remain consistent throughout the transcription and that the text is formatted neatly.
Here's the transcription:
"""
transciption = "Your input transcription here"
prompt = template + transcription
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
The following libraries were used:
transformersdatasetsunslothtorchTo install the dependencies, you can use:
pip install transformers datasets torch unsloth
If you use this model, please consider citing the base model and the dataset:
Base model
meta-llama/Llama-3.1-8B