Spaces:
Runtime error
Runtime error
bofenghuang
commited on
Commit
β’
76e0282
1
Parent(s):
abfaf19
up
Browse files- run_demo.py +5 -4
- run_demo_file.py +1 -1
- run_demo_microphone.py +1 -1
- run_demo_microphone_streaming.py +1 -1
run_demo.py
CHANGED
@@ -7,8 +7,6 @@ import librosa
|
|
7 |
from transformers import pipeline
|
8 |
from transformers.utils.logging import disable_progress_bar
|
9 |
|
10 |
-
SAMPLE_RATE = 16_000
|
11 |
-
|
12 |
warnings.filterwarnings("ignore")
|
13 |
|
14 |
disable_progress_bar()
|
@@ -20,7 +18,10 @@ logging.basicConfig(
|
|
20 |
logger = logging.getLogger(__name__)
|
21 |
logger.setLevel(logging.DEBUG)
|
22 |
|
23 |
-
|
|
|
|
|
|
|
24 |
logger.info("ASR pipeline has been initialized")
|
25 |
|
26 |
|
@@ -74,7 +75,7 @@ iface = gr.Interface(
|
|
74 |
layout="horizontal",
|
75 |
# theme="huggingface",
|
76 |
title="Speech-to-Text in French",
|
77 |
-
description="Realtime demo for French automatic speech recognition.",
|
78 |
allow_flagging="never",
|
79 |
)
|
80 |
|
|
|
7 |
from transformers import pipeline
|
8 |
from transformers.utils.logging import disable_progress_bar
|
9 |
|
|
|
|
|
10 |
warnings.filterwarnings("ignore")
|
11 |
|
12 |
disable_progress_bar()
|
|
|
18 |
logger = logging.getLogger(__name__)
|
19 |
logger.setLevel(logging.DEBUG)
|
20 |
|
21 |
+
MODEL_NAME = "bofenghuang/asr-wav2vec2-ctc-french"
|
22 |
+
SAMPLE_RATE = 16_000
|
23 |
+
|
24 |
+
pipe = pipeline(model=MODEL_NAME)
|
25 |
logger.info("ASR pipeline has been initialized")
|
26 |
|
27 |
|
|
|
75 |
layout="horizontal",
|
76 |
# theme="huggingface",
|
77 |
title="Speech-to-Text in French",
|
78 |
+
description=f"Realtime demo for French automatic speech recognition. Demo uses the the fine-tuned checkpoint [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and π€ Transformers to transcribe audio files of arbitrary length.",
|
79 |
allow_flagging="never",
|
80 |
)
|
81 |
|
run_demo_file.py
CHANGED
@@ -16,7 +16,7 @@ logging.basicConfig(
|
|
16 |
logger = logging.getLogger(__name__)
|
17 |
logger.setLevel(logging.DEBUG)
|
18 |
|
19 |
-
pipe = pipeline(model="bofenghuang/asr-wav2vec2-french")
|
20 |
logger.info("ASR pipeline has been initialized")
|
21 |
|
22 |
|
|
|
16 |
logger = logging.getLogger(__name__)
|
17 |
logger.setLevel(logging.DEBUG)
|
18 |
|
19 |
+
pipe = pipeline(model="bofenghuang/asr-wav2vec2-ctc-french")
|
20 |
logger.info("ASR pipeline has been initialized")
|
21 |
|
22 |
|
run_demo_microphone.py
CHANGED
@@ -16,7 +16,7 @@ logging.basicConfig(
|
|
16 |
logger = logging.getLogger(__name__)
|
17 |
logger.setLevel(logging.DEBUG)
|
18 |
|
19 |
-
pipe = pipeline(model="bofenghuang/asr-wav2vec2-french")
|
20 |
logger.info("ASR pipeline has been initialized")
|
21 |
|
22 |
|
|
|
16 |
logger = logging.getLogger(__name__)
|
17 |
logger.setLevel(logging.DEBUG)
|
18 |
|
19 |
+
pipe = pipeline(model="bofenghuang/asr-wav2vec2-ctc-french")
|
20 |
logger.info("ASR pipeline has been initialized")
|
21 |
|
22 |
|
run_demo_microphone_streaming.py
CHANGED
@@ -16,7 +16,7 @@ logging.basicConfig(
|
|
16 |
logger = logging.getLogger(__name__)
|
17 |
logger.setLevel(logging.DEBUG)
|
18 |
|
19 |
-
pipe = pipeline(model="bofenghuang/asr-wav2vec2-french")
|
20 |
logger.info("ASR pipeline has been initialized")
|
21 |
|
22 |
|
|
|
16 |
logger = logging.getLogger(__name__)
|
17 |
logger.setLevel(logging.DEBUG)
|
18 |
|
19 |
+
pipe = pipeline(model="bofenghuang/asr-wav2vec2-ctc-french")
|
20 |
logger.info("ASR pipeline has been initialized")
|
21 |
|
22 |
|