Spaces:
Running
Running
chore: Adapt code to make it 3.10.x compatible
Browse files
src/pronunciation_trainer/transcription.py
CHANGED
@@ -5,14 +5,14 @@ The transcribe function takes a single parameter, audio, which is a numpy array
|
|
5 |
|
6 |
There are two transcriber choices available: grapheme and phoneme. The grapheme transcriber uses the openai/whisper-base.en model, while the phoneme transcriber uses the facebook/wav2vec2-lv-60-espeak-cv-ft model.
|
7 |
"""
|
8 |
-
from enum import
|
9 |
from functools import partial
|
10 |
|
11 |
import numpy as np
|
12 |
from transformers import pipeline
|
13 |
|
14 |
|
15 |
-
class TranscriberChoice(
|
16 |
grapheme = "openai/whisper-base.en"
|
17 |
phoneme = "facebook/wav2vec2-lv-60-espeak-cv-ft"
|
18 |
|
|
|
5 |
|
6 |
There are two transcriber choices available: grapheme and phoneme. The grapheme transcriber uses the openai/whisper-base.en model, while the phoneme transcriber uses the facebook/wav2vec2-lv-60-espeak-cv-ft model.
|
7 |
"""
|
8 |
+
from enum import Enum
|
9 |
from functools import partial
|
10 |
|
11 |
import numpy as np
|
12 |
from transformers import pipeline
|
13 |
|
14 |
|
15 |
+
class TranscriberChoice(str, Enum):
|
16 |
grapheme = "openai/whisper-base.en"
|
17 |
phoneme = "facebook/wav2vec2-lv-60-espeak-cv-ft"
|
18 |
|