Spaces:
Sleeping
Sleeping
Create list_speakers.py
Browse files- list_speakers.py +15 -0
list_speakers.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import pipeline, AutoModelForSpeechSeq2Seq, AutoProcessor
|
| 2 |
+
import os
|
| 3 |
+
|
| 4 |
+
# Hugging‑Face‑Token als Umgebungsvariable (sieh oben)
|
| 5 |
+
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 6 |
+
|
| 7 |
+
# Modell und Prozessor laden
|
| 8 |
+
model = AutoModelForSpeechSeq2Seq.from_pretrained("SebastianBodza/Kartoffelbox-v0.1", use_auth_token=HF_TOKEN)
|
| 9 |
+
processor = AutoProcessor.from_pretrained("SebastianBodza/Kartoffelbox-v0.1", use_auth_token=HF_TOKEN)
|
| 10 |
+
|
| 11 |
+
# Wenn das Modell Speaker‑Listen in der Config speichert:
|
| 12 |
+
speakers = getattr(model.config, "speakers", None) or getattr(processor, "speaker_ids_to_tokens", None)
|
| 13 |
+
|
| 14 |
+
print("Verfügbare Speaker‑IDs:")
|
| 15 |
+
print(speakers)
|