-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Michael Hansen
committed
Feb 8, 2020
1 parent
5cc330a
commit ed06cee
Showing
14 changed files
with
117 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
"""Github-like download interface""" | ||
import typing | ||
from pathlib import Path | ||
from uuid import uuid4 | ||
|
||
from quart import Quart, send_from_directory, Response | ||
|
||
app = Quart("rhasspy") | ||
app.secret_key = str(uuid4()) | ||
|
||
# ----------------------------------------------------------------------------- | ||
|
||
profile_dirs: typing.Dict[str, Path] = {} | ||
for check_dir in Path(".").glob("*"): | ||
if not check_dir.is_dir(): | ||
continue | ||
|
||
for profile_dir in check_dir.glob("*"): | ||
if not profile_dir.is_dir(): | ||
continue | ||
|
||
profile_yml = profile_dir / "profile.yml" | ||
if profile_yml.is_file(): | ||
profile_dirs[profile_dir.name] = profile_dir | ||
|
||
# ----------------------------------------------------------------------------- | ||
|
||
|
||
@app.route("/<path:path>") | ||
async def download_raw(path: str) -> Response: | ||
components = path.split("/") | ||
profile = components[0] | ||
artifact = "/".join(components[3:]) | ||
|
||
profile_dir = profile_dirs.get(profile) | ||
assert profile_dir, f"Missing directory for {profile}" | ||
|
||
return await send_from_directory(profile_dir, artifact) | ||
|
||
|
||
# ----------------------------------------------------------------------------- | ||
|
||
if __name__ == "__main__": | ||
app.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env python3 | ||
import argparse | ||
import json | ||
import os | ||
import sys | ||
from pathlib import Path | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser(prog="make_download_json.py") | ||
# parser.add_argument("url_base") | ||
parser.add_argument("profile_dir") | ||
parser.add_argument("files", nargs="+") | ||
args = parser.parse_args() | ||
|
||
# url_base = args.url_base | ||
profile_dir = Path(args.profile_dir).absolute() | ||
files = {} | ||
for file_name in args.files: | ||
file_path = Path(file_name).absolute() | ||
file_key = str(file_path.relative_to(profile_dir)) | ||
files[file_key] = file_path | ||
|
||
json.dump( | ||
{ | ||
"conditions": { | ||
file_key: f"{profile_dir.name}/{file_key}" for file_key in files | ||
}, | ||
"files": { | ||
f"{profile_dir.name}/{file_key}": { | ||
"url": f"{profile_dir.name}/raw/master/{file_key}", | ||
"bytes_expected": os.path.getsize(file_path), | ||
"unzip": file_path.suffix == ".gz", | ||
} | ||
for file_key, file_path in files.items() | ||
}, | ||
}, | ||
sys.stdout, | ||
indent=4, | ||
) | ||
|
||
|
||
# ----------------------------------------------------------------------------- | ||
|
||
if __name__ == "__main__": | ||
main() |
Submodule en-us_julius-github
updated
from c1e402 to cbdb73
Submodule en-us_kaldi-zamia
updated
6 files
Submodule en-us_pocketsphinx-cmu
updated
7 files
+3 −3 | espeak_phonemes.txt | |
+39 −0 | ipa_phonemes.txt | |
+ − | marytts/marytts-lang-en-5.2.jar | |
+ − | marytts/voice-cmu-slt-hsmm-5.2.jar | |
+39 −0 | marytts_phonemes.txt | |
+38 −39 | phoneme_examples.txt | |
+2 −0 | profile.yml |
Submodule fr_pocketsphinx-cmu
updated
5 files
+4 −4 | espeak_phonemes.txt | |
+ − | marytts/marytts-lang-fr-5.2.jar | |
+ − | marytts/voice-upmc-pierre-hsmm-5.2.jar | |
+26 −26 | phoneme_examples.txt | |
+2 −0 | profile.yml |
Submodule de_kaldi-zamia
updated
3 files
+ − | marytts/marytts-lang-de-5.2.jar | |
+ − | marytts/voice-bits1-hsmm-5.2.jar | |
+2 −0 | profile.yml |
Submodule de_pocketsphinx-cmu
updated
4 files
+ − | marytts/marytts-lang-de-5.2.jar | |
+ − | marytts/voice-bits1-hsmm-5.2.jar | |
+13 −12 | phoneme_examples.txt | |
+2 −0 | profile.yml |
Submodule it_pocketsphinx-cmu
updated
3 files
+ − | marytts/marytts-lang-it-5.2.jar | |
+ − | marytts/voice-istc-lucia-hsmm-5.2.jar | |
+2 −0 | profile.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ requests | |
pyyaml | ||
pydash | ||
conllu | ||
quart==0.6.15 |