Views
No views yet
q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj.1616French_MultiSpeaker_Diarization dataset, hosted on the Hugging Face Hub:120,0000nonellama-3.1 template).FastLanguageModel.from_pretrained().unsloth.chat_templates library.apply_chat_template() to suit the diarization task.1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "olafdil/FrDiarization-Llama-3.1-8B-4bit"
4model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype="auto")
5tokenizer = AutoTokenizer.from_pretrained(model_name)1template = """
2I have an audio transcription where multiple speakers are involved in a conversation.
3Your task is to distinguish the different speakers and diarize the text accordingly.
4Each speaker's dialogue should be clearly labeled, such as 'Speaker 1:', 'Speaker 2:', etc.
5Ensure that the labels remain consistent throughout the transcription and that the text is formatted neatly.
6Here's the transcription:
7"""
8transciption = "Your input transcription here"
9prompt = template + transcription
10
11inputs = tokenizer(prompt, return_tensors="pt")
12outputs = model.generate(**inputs)
13print(tokenizer.decode(outputs[0], skip_special_tokens=True))transformersdatasetsunslothtorchpip install transformers datasets torch unsloth