NathanRoll commited on
Commit
97f7de5
·
verified ·
1 Parent(s): 555136b

Add Orukeet v0.1.0 inference package and example

Browse files
orukeet-0.1.0-py3-none-any.whl ADDED
Binary file (26.9 kB). View file
 
orukeet-0.1.0.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:65f57199c411bd266dfabf2800957ebf56c65b25de038f6930ce8d89f9c71929
3
+ size 31074
transcribe.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Use an installation receipt without downloading anything during transcription."""
2
+ import argparse
3
+ import json
4
+ import sys
5
+ from pathlib import Path
6
+
7
+ from orukeet import Orukeet
8
+
9
+
10
+ def main():
11
+ if hasattr(sys.stdout, "reconfigure"):
12
+ sys.stdout.reconfigure(encoding="utf-8")
13
+ parser = argparse.ArgumentParser(description=__doc__)
14
+ parser.add_argument('audio', type=Path, nargs='+')
15
+ parser.add_argument('--installation', type=Path, default=Path('installation.json'))
16
+ args = parser.parse_args()
17
+ config = json.loads(args.installation.read_text(encoding='utf-8-sig'))
18
+ with Orukeet(config['model'], config['runtime'], device=config['device']) as model:
19
+ for path in args.audio:
20
+ print(json.dumps({'file': str(path), **model.transcribe(path)}, ensure_ascii=False))
21
+
22
+
23
+ if __name__ == '__main__':
24
+ main()