Kartoffel161 / list_speakers.py
UnSinnlos's picture
Create list_speakers.py
0e1ed60 verified
from transformers import pipeline, AutoModelForSpeechSeq2Seq, AutoProcessor
import os
# Hugging‑Face‑Token als Umgebungsvariable (sieh oben)
HF_TOKEN = os.getenv("HF_TOKEN")
# Modell und Prozessor laden
model = AutoModelForSpeechSeq2Seq.from_pretrained("SebastianBodza/Kartoffelbox-v0.1", use_auth_token=HF_TOKEN)
processor = AutoProcessor.from_pretrained("SebastianBodza/Kartoffelbox-v0.1", use_auth_token=HF_TOKEN)
# Wenn das Modell Speaker‑Listen in der Config speichert:
speakers = getattr(model.config, "speakers", None) or getattr(processor, "speaker_ids_to_tokens", None)
print("Verfügbare Speaker‑IDs:")
print(speakers)