Spaces:
Sleeping
Sleeping
update
Browse files
main.py
CHANGED
|
@@ -14,6 +14,7 @@ log.setup(log_directory=log_directory)
|
|
| 14 |
import azure.cognitiveservices.speech as speechsdk
|
| 15 |
import gradio as gr
|
| 16 |
|
|
|
|
| 17 |
from toolbox.os.command import Command
|
| 18 |
|
| 19 |
main_logger = logging.getLogger("main")
|
|
@@ -25,7 +26,16 @@ def shell(cmd: str):
|
|
| 25 |
|
| 26 |
def get_args():
|
| 27 |
parser = argparse.ArgumentParser()
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
parser.add_argument(
|
| 30 |
"--asr_examples_wav_dir",
|
| 31 |
default=(project_path / "data/asr_examples").as_posix(),
|
|
@@ -73,7 +83,9 @@ def main():
|
|
| 73 |
|
| 74 |
asr_examples.append([
|
| 75 |
filename.as_posix(),
|
| 76 |
-
language
|
|
|
|
|
|
|
| 77 |
])
|
| 78 |
|
| 79 |
title = "## Azure Service."
|
|
|
|
| 14 |
import azure.cognitiveservices.speech as speechsdk
|
| 15 |
import gradio as gr
|
| 16 |
|
| 17 |
+
from project_settings import environment, project_path
|
| 18 |
from toolbox.os.command import Command
|
| 19 |
|
| 20 |
main_logger = logging.getLogger("main")
|
|
|
|
| 26 |
|
| 27 |
def get_args():
|
| 28 |
parser = argparse.ArgumentParser()
|
| 29 |
+
parser.add_argument(
|
| 30 |
+
"--speech_key",
|
| 31 |
+
default=environment.get("speech_key"),
|
| 32 |
+
type=str
|
| 33 |
+
)
|
| 34 |
+
parser.add_argument(
|
| 35 |
+
"--service_region",
|
| 36 |
+
default=environment.get("service_region"),
|
| 37 |
+
type=str
|
| 38 |
+
)
|
| 39 |
parser.add_argument(
|
| 40 |
"--asr_examples_wav_dir",
|
| 41 |
default=(project_path / "data/asr_examples").as_posix(),
|
|
|
|
| 83 |
|
| 84 |
asr_examples.append([
|
| 85 |
filename.as_posix(),
|
| 86 |
+
language,
|
| 87 |
+
args.speech_key,
|
| 88 |
+
args.service_region,
|
| 89 |
])
|
| 90 |
|
| 91 |
title = "## Azure Service."
|