Spaces:
Sleeping
Sleeping
update
Browse files- logs/alarm.log +0 -0
- logs/api.log +0 -0
- logs/debug.log +219 -0
- logs/error.log +0 -0
- logs/http.log +0 -0
- logs/info.log +3 -0
- logs/main.log +0 -0
- toolbox/k2_sherpa/decode.py +3 -2
- toolbox/k2_sherpa/nn_models.py +70 -41
logs/alarm.log
ADDED
|
File without changes
|
logs/api.log
ADDED
|
File without changes
|
logs/debug.log
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
2024-05-11 16:02:05,316 - httpx - DEBUG _config.py:80 > load_ssl_context verify=True cert=None trust_env=True http2=False
|
| 2 |
+
2024-05-11 16:02:05,325 - httpx - DEBUG _config.py:80 > load_ssl_context verify=True cert=None trust_env=True http2=False
|
| 3 |
+
2024-05-11 16:02:05,329 - httpx - DEBUG _config.py:146 > load_verify_locations cafile='D:\\Users\\tianx\\PycharmProjects\\virtualenv\\asr\\lib\\site-packages\\certifi\\cacert.pem'
|
| 4 |
+
2024-05-11 16:02:05,329 - httpx - DEBUG _config.py:146 > load_verify_locations cafile='D:\\Users\\tianx\\PycharmProjects\\virtualenv\\asr\\lib\\site-packages\\certifi\\cacert.pem'
|
| 5 |
+
2024-05-11 16:02:05,340 - httpcore.connection - DEBUG _trace.py:45 > connect_tcp.started host='api.gradio.app' port=443 local_address=None timeout=3 socket_options=None
|
| 6 |
+
2024-05-11 16:02:05,340 - httpx - DEBUG _config.py:80 > load_ssl_context verify=True cert=None trust_env=True http2=False
|
| 7 |
+
2024-05-11 16:02:05,341 - httpx - DEBUG _config.py:146 > load_verify_locations cafile='D:\\Users\\tianx\\PycharmProjects\\virtualenv\\asr\\lib\\site-packages\\certifi\\cacert.pem'
|
| 8 |
+
2024-05-11 16:02:05,504 - httpx - DEBUG _config.py:80 > load_ssl_context verify=True cert=None trust_env=True http2=False
|
| 9 |
+
2024-05-11 16:02:05,504 - httpx - DEBUG _config.py:146 > load_verify_locations cafile='D:\\Users\\tianx\\PycharmProjects\\virtualenv\\asr\\lib\\site-packages\\certifi\\cacert.pem'
|
| 10 |
+
2024-05-11 16:02:05,560 - httpcore.connection - DEBUG _trace.py:45 > connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x0000025DA2690CA0>
|
| 11 |
+
2024-05-11 16:02:05,560 - httpcore.connection - DEBUG _trace.py:45 > start_tls.started ssl_context=<ssl.SSLContext object at 0x0000025DA26796C0> server_hostname='api.gradio.app' timeout=3
|
| 12 |
+
2024-05-11 16:02:05,659 - PIL.Image - DEBUG Image.py:376 > Importing BlpImagePlugin
|
| 13 |
+
2024-05-11 16:02:05,661 - PIL.Image - DEBUG Image.py:376 > Importing BmpImagePlugin
|
| 14 |
+
2024-05-11 16:02:05,662 - PIL.Image - DEBUG Image.py:376 > Importing BufrStubImagePlugin
|
| 15 |
+
2024-05-11 16:02:05,663 - PIL.Image - DEBUG Image.py:376 > Importing CurImagePlugin
|
| 16 |
+
2024-05-11 16:02:05,663 - PIL.Image - DEBUG Image.py:376 > Importing DcxImagePlugin
|
| 17 |
+
2024-05-11 16:02:05,665 - PIL.Image - DEBUG Image.py:376 > Importing DdsImagePlugin
|
| 18 |
+
2024-05-11 16:02:05,667 - PIL.Image - DEBUG Image.py:376 > Importing EpsImagePlugin
|
| 19 |
+
2024-05-11 16:02:05,669 - PIL.Image - DEBUG Image.py:376 > Importing FitsImagePlugin
|
| 20 |
+
2024-05-11 16:02:05,670 - PIL.Image - DEBUG Image.py:376 > Importing FliImagePlugin
|
| 21 |
+
2024-05-11 16:02:05,670 - PIL.Image - DEBUG Image.py:376 > Importing FpxImagePlugin
|
| 22 |
+
2024-05-11 16:02:05,672 - PIL.Image - DEBUG Image.py:379 > Image: failed to import FpxImagePlugin: No module named 'olefile'
|
| 23 |
+
2024-05-11 16:02:05,672 - PIL.Image - DEBUG Image.py:376 > Importing FtexImagePlugin
|
| 24 |
+
2024-05-11 16:02:05,672 - PIL.Image - DEBUG Image.py:376 > Importing GbrImagePlugin
|
| 25 |
+
2024-05-11 16:02:05,673 - PIL.Image - DEBUG Image.py:376 > Importing GifImagePlugin
|
| 26 |
+
2024-05-11 16:02:05,675 - PIL.Image - DEBUG Image.py:376 > Importing GribStubImagePlugin
|
| 27 |
+
2024-05-11 16:02:05,676 - PIL.Image - DEBUG Image.py:376 > Importing Hdf5StubImagePlugin
|
| 28 |
+
2024-05-11 16:02:05,677 - PIL.Image - DEBUG Image.py:376 > Importing IcnsImagePlugin
|
| 29 |
+
2024-05-11 16:02:05,679 - PIL.Image - DEBUG Image.py:376 > Importing IcoImagePlugin
|
| 30 |
+
2024-05-11 16:02:05,680 - PIL.Image - DEBUG Image.py:376 > Importing ImImagePlugin
|
| 31 |
+
2024-05-11 16:02:05,681 - PIL.Image - DEBUG Image.py:376 > Importing ImtImagePlugin
|
| 32 |
+
2024-05-11 16:02:05,681 - PIL.Image - DEBUG Image.py:376 > Importing IptcImagePlugin
|
| 33 |
+
2024-05-11 16:02:05,682 - PIL.Image - DEBUG Image.py:376 > Importing JpegImagePlugin
|
| 34 |
+
2024-05-11 16:02:05,683 - PIL.Image - DEBUG Image.py:376 > Importing Jpeg2KImagePlugin
|
| 35 |
+
2024-05-11 16:02:05,683 - PIL.Image - DEBUG Image.py:376 > Importing McIdasImagePlugin
|
| 36 |
+
2024-05-11 16:02:05,684 - PIL.Image - DEBUG Image.py:376 > Importing MicImagePlugin
|
| 37 |
+
2024-05-11 16:02:05,684 - PIL.Image - DEBUG Image.py:379 > Image: failed to import MicImagePlugin: No module named 'olefile'
|
| 38 |
+
2024-05-11 16:02:05,684 - PIL.Image - DEBUG Image.py:376 > Importing MpegImagePlugin
|
| 39 |
+
2024-05-11 16:02:05,685 - PIL.Image - DEBUG Image.py:376 > Importing MpoImagePlugin
|
| 40 |
+
2024-05-11 16:02:05,687 - PIL.Image - DEBUG Image.py:376 > Importing MspImagePlugin
|
| 41 |
+
2024-05-11 16:02:05,687 - PIL.Image - DEBUG Image.py:376 > Importing PalmImagePlugin
|
| 42 |
+
2024-05-11 16:02:05,690 - PIL.Image - DEBUG Image.py:376 > Importing PcdImagePlugin
|
| 43 |
+
2024-05-11 16:02:05,690 - PIL.Image - DEBUG Image.py:376 > Importing PcxImagePlugin
|
| 44 |
+
2024-05-11 16:02:05,690 - PIL.Image - DEBUG Image.py:376 > Importing PdfImagePlugin
|
| 45 |
+
2024-05-11 16:02:05,695 - PIL.Image - DEBUG Image.py:376 > Importing PixarImagePlugin
|
| 46 |
+
2024-05-11 16:02:05,695 - PIL.Image - DEBUG Image.py:376 > Importing PngImagePlugin
|
| 47 |
+
2024-05-11 16:02:05,696 - PIL.Image - DEBUG Image.py:376 > Importing PpmImagePlugin
|
| 48 |
+
2024-05-11 16:02:05,696 - PIL.Image - DEBUG Image.py:376 > Importing PsdImagePlugin
|
| 49 |
+
2024-05-11 16:02:05,697 - PIL.Image - DEBUG Image.py:376 > Importing QoiImagePlugin
|
| 50 |
+
2024-05-11 16:02:05,698 - PIL.Image - DEBUG Image.py:376 > Importing SgiImagePlugin
|
| 51 |
+
2024-05-11 16:02:05,699 - PIL.Image - DEBUG Image.py:376 > Importing SpiderImagePlugin
|
| 52 |
+
2024-05-11 16:02:05,699 - PIL.Image - DEBUG Image.py:376 > Importing SunImagePlugin
|
| 53 |
+
2024-05-11 16:02:05,700 - PIL.Image - DEBUG Image.py:376 > Importing TgaImagePlugin
|
| 54 |
+
2024-05-11 16:02:05,701 - PIL.Image - DEBUG Image.py:376 > Importing TiffImagePlugin
|
| 55 |
+
2024-05-11 16:02:05,701 - PIL.Image - DEBUG Image.py:376 > Importing WebPImagePlugin
|
| 56 |
+
2024-05-11 16:02:05,703 - PIL.Image - DEBUG Image.py:376 > Importing WmfImagePlugin
|
| 57 |
+
2024-05-11 16:02:05,704 - PIL.Image - DEBUG Image.py:376 > Importing XbmImagePlugin
|
| 58 |
+
2024-05-11 16:02:05,705 - PIL.Image - DEBUG Image.py:376 > Importing XpmImagePlugin
|
| 59 |
+
2024-05-11 16:02:05,706 - PIL.Image - DEBUG Image.py:376 > Importing XVThumbImagePlugin
|
| 60 |
+
2024-05-11 16:02:05,898 - httpcore.connection - DEBUG _trace.py:45 > start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x0000025DA2690550>
|
| 61 |
+
2024-05-11 16:02:05,898 - httpcore.http11 - DEBUG _trace.py:45 > send_request_headers.started request=<Request [b'GET']>
|
| 62 |
+
2024-05-11 16:02:05,898 - httpcore.http11 - DEBUG _trace.py:45 > send_request_headers.complete
|
| 63 |
+
2024-05-11 16:02:05,898 - httpcore.http11 - DEBUG _trace.py:45 > send_request_body.started request=<Request [b'GET']>
|
| 64 |
+
2024-05-11 16:02:05,898 - httpcore.http11 - DEBUG _trace.py:45 > send_request_body.complete
|
| 65 |
+
2024-05-11 16:02:05,898 - httpcore.http11 - DEBUG _trace.py:45 > receive_response_headers.started request=<Request [b'GET']>
|
| 66 |
+
2024-05-11 16:02:06,066 - httpcore.http11 - DEBUG _trace.py:45 > receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Sat, 11 May 2024 08:02:05 GMT'), (b'Content-Type', b'application/json'), (b'Content-Length', b'3'), (b'Connection', b'keep-alive'), (b'Server', b'nginx/1.18.0'), (b'Access-Control-Allow-Origin', b'*')])
|
| 67 |
+
2024-05-11 16:02:06,066 - httpx - INFO _client.py:1026 > HTTP Request: GET https://api.gradio.app/gradio-messaging/en "HTTP/1.1 200 OK"
|
| 68 |
+
2024-05-11 16:02:06,067 - httpcore.http11 - DEBUG _trace.py:45 > receive_response_body.started request=<Request [b'GET']>
|
| 69 |
+
2024-05-11 16:02:06,067 - httpcore.http11 - DEBUG _trace.py:45 > receive_response_body.complete
|
| 70 |
+
2024-05-11 16:02:06,067 - httpcore.http11 - DEBUG _trace.py:45 > response_closed.started
|
| 71 |
+
2024-05-11 16:02:06,067 - httpcore.http11 - DEBUG _trace.py:45 > response_closed.complete
|
| 72 |
+
2024-05-11 16:02:06,067 - httpcore.connection - DEBUG _trace.py:45 > close.started
|
| 73 |
+
2024-05-11 16:02:06,067 - httpcore.connection - DEBUG _trace.py:45 > close.complete
|
| 74 |
+
2024-05-11 16:02:26,740 - httpx - DEBUG _config.py:80 > load_ssl_context verify=True cert=None trust_env=True http2=False
|
| 75 |
+
2024-05-11 16:02:26,742 - httpx - DEBUG _config.py:146 > load_verify_locations cafile='D:\\Users\\tianx\\PycharmProjects\\virtualenv\\asr\\lib\\site-packages\\certifi\\cacert.pem'
|
| 76 |
+
2024-05-11 16:02:26,747 - httpx - DEBUG _config.py:80 > load_ssl_context verify=True cert=None trust_env=True http2=False
|
| 77 |
+
2024-05-11 16:02:26,747 - httpx - DEBUG _config.py:146 > load_verify_locations cafile='D:\\Users\\tianx\\PycharmProjects\\virtualenv\\asr\\lib\\site-packages\\certifi\\cacert.pem'
|
| 78 |
+
2024-05-11 16:02:26,750 - httpcore.connection - DEBUG _trace.py:45 > connect_tcp.started host='api.gradio.app' port=443 local_address=None timeout=3 socket_options=None
|
| 79 |
+
2024-05-11 16:02:26,755 - httpx - DEBUG _config.py:80 > load_ssl_context verify=True cert=None trust_env=True http2=False
|
| 80 |
+
2024-05-11 16:02:26,756 - httpx - DEBUG _config.py:146 > load_verify_locations cafile='D:\\Users\\tianx\\PycharmProjects\\virtualenv\\asr\\lib\\site-packages\\certifi\\cacert.pem'
|
| 81 |
+
2024-05-11 16:02:26,885 - httpx - DEBUG _config.py:80 > load_ssl_context verify=True cert=None trust_env=True http2=False
|
| 82 |
+
2024-05-11 16:02:26,885 - httpx - DEBUG _config.py:146 > load_verify_locations cafile='D:\\Users\\tianx\\PycharmProjects\\virtualenv\\asr\\lib\\site-packages\\certifi\\cacert.pem'
|
| 83 |
+
2024-05-11 16:02:26,915 - httpcore.connection - DEBUG _trace.py:45 > connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x0000021DC186B670>
|
| 84 |
+
2024-05-11 16:02:26,916 - httpcore.connection - DEBUG _trace.py:45 > start_tls.started ssl_context=<ssl.SSLContext object at 0x0000021DC1102DC0> server_hostname='api.gradio.app' timeout=3
|
| 85 |
+
2024-05-11 16:02:26,959 - PIL.Image - DEBUG Image.py:376 > Importing BlpImagePlugin
|
| 86 |
+
2024-05-11 16:02:26,960 - PIL.Image - DEBUG Image.py:376 > Importing BmpImagePlugin
|
| 87 |
+
2024-05-11 16:02:26,961 - PIL.Image - DEBUG Image.py:376 > Importing BufrStubImagePlugin
|
| 88 |
+
2024-05-11 16:02:26,961 - PIL.Image - DEBUG Image.py:376 > Importing CurImagePlugin
|
| 89 |
+
2024-05-11 16:02:26,962 - PIL.Image - DEBUG Image.py:376 > Importing DcxImagePlugin
|
| 90 |
+
2024-05-11 16:02:26,963 - PIL.Image - DEBUG Image.py:376 > Importing DdsImagePlugin
|
| 91 |
+
2024-05-11 16:02:26,965 - PIL.Image - DEBUG Image.py:376 > Importing EpsImagePlugin
|
| 92 |
+
2024-05-11 16:02:26,966 - PIL.Image - DEBUG Image.py:376 > Importing FitsImagePlugin
|
| 93 |
+
2024-05-11 16:02:26,967 - PIL.Image - DEBUG Image.py:376 > Importing FliImagePlugin
|
| 94 |
+
2024-05-11 16:02:26,967 - PIL.Image - DEBUG Image.py:376 > Importing FpxImagePlugin
|
| 95 |
+
2024-05-11 16:02:26,968 - PIL.Image - DEBUG Image.py:379 > Image: failed to import FpxImagePlugin: No module named 'olefile'
|
| 96 |
+
2024-05-11 16:02:26,968 - PIL.Image - DEBUG Image.py:376 > Importing FtexImagePlugin
|
| 97 |
+
2024-05-11 16:02:26,968 - PIL.Image - DEBUG Image.py:376 > Importing GbrImagePlugin
|
| 98 |
+
2024-05-11 16:02:26,969 - PIL.Image - DEBUG Image.py:376 > Importing GifImagePlugin
|
| 99 |
+
2024-05-11 16:02:26,970 - PIL.Image - DEBUG Image.py:376 > Importing GribStubImagePlugin
|
| 100 |
+
2024-05-11 16:02:26,970 - PIL.Image - DEBUG Image.py:376 > Importing Hdf5StubImagePlugin
|
| 101 |
+
2024-05-11 16:02:26,971 - PIL.Image - DEBUG Image.py:376 > Importing IcnsImagePlugin
|
| 102 |
+
2024-05-11 16:02:26,972 - PIL.Image - DEBUG Image.py:376 > Importing IcoImagePlugin
|
| 103 |
+
2024-05-11 16:02:26,972 - PIL.Image - DEBUG Image.py:376 > Importing ImImagePlugin
|
| 104 |
+
2024-05-11 16:02:26,973 - PIL.Image - DEBUG Image.py:376 > Importing ImtImagePlugin
|
| 105 |
+
2024-05-11 16:02:26,974 - PIL.Image - DEBUG Image.py:376 > Importing IptcImagePlugin
|
| 106 |
+
2024-05-11 16:02:26,974 - PIL.Image - DEBUG Image.py:376 > Importing JpegImagePlugin
|
| 107 |
+
2024-05-11 16:02:26,975 - PIL.Image - DEBUG Image.py:376 > Importing Jpeg2KImagePlugin
|
| 108 |
+
2024-05-11 16:02:26,975 - PIL.Image - DEBUG Image.py:376 > Importing McIdasImagePlugin
|
| 109 |
+
2024-05-11 16:02:26,975 - PIL.Image - DEBUG Image.py:376 > Importing MicImagePlugin
|
| 110 |
+
2024-05-11 16:02:26,976 - PIL.Image - DEBUG Image.py:379 > Image: failed to import MicImagePlugin: No module named 'olefile'
|
| 111 |
+
2024-05-11 16:02:26,976 - PIL.Image - DEBUG Image.py:376 > Importing MpegImagePlugin
|
| 112 |
+
2024-05-11 16:02:26,976 - PIL.Image - DEBUG Image.py:376 > Importing MpoImagePlugin
|
| 113 |
+
2024-05-11 16:02:26,977 - PIL.Image - DEBUG Image.py:376 > Importing MspImagePlugin
|
| 114 |
+
2024-05-11 16:02:26,978 - PIL.Image - DEBUG Image.py:376 > Importing PalmImagePlugin
|
| 115 |
+
2024-05-11 16:02:26,979 - PIL.Image - DEBUG Image.py:376 > Importing PcdImagePlugin
|
| 116 |
+
2024-05-11 16:02:26,979 - PIL.Image - DEBUG Image.py:376 > Importing PcxImagePlugin
|
| 117 |
+
2024-05-11 16:02:26,979 - PIL.Image - DEBUG Image.py:376 > Importing PdfImagePlugin
|
| 118 |
+
2024-05-11 16:02:26,983 - PIL.Image - DEBUG Image.py:376 > Importing PixarImagePlugin
|
| 119 |
+
2024-05-11 16:02:26,983 - PIL.Image - DEBUG Image.py:376 > Importing PngImagePlugin
|
| 120 |
+
2024-05-11 16:02:26,983 - PIL.Image - DEBUG Image.py:376 > Importing PpmImagePlugin
|
| 121 |
+
2024-05-11 16:02:26,984 - PIL.Image - DEBUG Image.py:376 > Importing PsdImagePlugin
|
| 122 |
+
2024-05-11 16:02:26,984 - PIL.Image - DEBUG Image.py:376 > Importing QoiImagePlugin
|
| 123 |
+
2024-05-11 16:02:26,984 - PIL.Image - DEBUG Image.py:376 > Importing SgiImagePlugin
|
| 124 |
+
2024-05-11 16:02:26,985 - PIL.Image - DEBUG Image.py:376 > Importing SpiderImagePlugin
|
| 125 |
+
2024-05-11 16:02:26,985 - PIL.Image - DEBUG Image.py:376 > Importing SunImagePlugin
|
| 126 |
+
2024-05-11 16:02:26,986 - PIL.Image - DEBUG Image.py:376 > Importing TgaImagePlugin
|
| 127 |
+
2024-05-11 16:02:26,986 - PIL.Image - DEBUG Image.py:376 > Importing TiffImagePlugin
|
| 128 |
+
2024-05-11 16:02:26,986 - PIL.Image - DEBUG Image.py:376 > Importing WebPImagePlugin
|
| 129 |
+
2024-05-11 16:02:26,987 - PIL.Image - DEBUG Image.py:376 > Importing WmfImagePlugin
|
| 130 |
+
2024-05-11 16:02:26,987 - PIL.Image - DEBUG Image.py:376 > Importing XbmImagePlugin
|
| 131 |
+
2024-05-11 16:02:26,988 - PIL.Image - DEBUG Image.py:376 > Importing XpmImagePlugin
|
| 132 |
+
2024-05-11 16:02:26,988 - PIL.Image - DEBUG Image.py:376 > Importing XVThumbImagePlugin
|
| 133 |
+
2024-05-11 16:02:27,273 - httpcore.connection - DEBUG _trace.py:45 > start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x0000021DC186B4C0>
|
| 134 |
+
2024-05-11 16:02:27,274 - httpcore.http11 - DEBUG _trace.py:45 > send_request_headers.started request=<Request [b'GET']>
|
| 135 |
+
2024-05-11 16:02:27,284 - httpcore.http11 - DEBUG _trace.py:45 > send_request_headers.complete
|
| 136 |
+
2024-05-11 16:02:27,284 - httpcore.http11 - DEBUG _trace.py:45 > send_request_body.started request=<Request [b'GET']>
|
| 137 |
+
2024-05-11 16:02:27,284 - httpcore.http11 - DEBUG _trace.py:45 > send_request_body.complete
|
| 138 |
+
2024-05-11 16:02:27,284 - httpcore.http11 - DEBUG _trace.py:45 > receive_response_headers.started request=<Request [b'GET']>
|
| 139 |
+
2024-05-11 16:02:27,451 - httpcore.http11 - DEBUG _trace.py:45 > receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Sat, 11 May 2024 08:02:27 GMT'), (b'Content-Type', b'application/json'), (b'Content-Length', b'3'), (b'Connection', b'keep-alive'), (b'Server', b'nginx/1.18.0'), (b'Access-Control-Allow-Origin', b'*')])
|
| 140 |
+
2024-05-11 16:02:27,452 - httpx - INFO _client.py:1026 > HTTP Request: GET https://api.gradio.app/gradio-messaging/en "HTTP/1.1 200 OK"
|
| 141 |
+
2024-05-11 16:02:27,452 - httpcore.http11 - DEBUG _trace.py:45 > receive_response_body.started request=<Request [b'GET']>
|
| 142 |
+
2024-05-11 16:02:27,454 - httpcore.http11 - DEBUG _trace.py:45 > receive_response_body.complete
|
| 143 |
+
2024-05-11 16:02:27,454 - httpcore.http11 - DEBUG _trace.py:45 > response_closed.started
|
| 144 |
+
2024-05-11 16:02:27,454 - httpcore.http11 - DEBUG _trace.py:45 > response_closed.complete
|
| 145 |
+
2024-05-11 16:02:27,455 - httpcore.connection - DEBUG _trace.py:45 > close.started
|
| 146 |
+
2024-05-11 16:02:27,458 - httpcore.connection - DEBUG _trace.py:45 > close.complete
|
| 147 |
+
2024-05-11 16:03:02,229 - httpx - DEBUG _config.py:80 > load_ssl_context verify=True cert=None trust_env=True http2=False
|
| 148 |
+
2024-05-11 16:03:02,231 - httpx - DEBUG _config.py:146 > load_verify_locations cafile='D:\\Users\\tianx\\PycharmProjects\\virtualenv\\asr\\lib\\site-packages\\certifi\\cacert.pem'
|
| 149 |
+
2024-05-11 16:03:02,236 - httpx - DEBUG _config.py:80 > load_ssl_context verify=True cert=None trust_env=True http2=False
|
| 150 |
+
2024-05-11 16:03:02,237 - httpx - DEBUG _config.py:146 > load_verify_locations cafile='D:\\Users\\tianx\\PycharmProjects\\virtualenv\\asr\\lib\\site-packages\\certifi\\cacert.pem'
|
| 151 |
+
2024-05-11 16:03:02,239 - httpcore.connection - DEBUG _trace.py:45 > connect_tcp.started host='api.gradio.app' port=443 local_address=None timeout=3 socket_options=None
|
| 152 |
+
2024-05-11 16:03:02,244 - httpx - DEBUG _config.py:80 > load_ssl_context verify=True cert=None trust_env=True http2=False
|
| 153 |
+
2024-05-11 16:03:02,245 - httpx - DEBUG _config.py:146 > load_verify_locations cafile='D:\\Users\\tianx\\PycharmProjects\\virtualenv\\asr\\lib\\site-packages\\certifi\\cacert.pem'
|
| 154 |
+
2024-05-11 16:03:02,379 - httpx - DEBUG _config.py:80 > load_ssl_context verify=True cert=None trust_env=True http2=False
|
| 155 |
+
2024-05-11 16:03:02,379 - httpx - DEBUG _config.py:146 > load_verify_locations cafile='D:\\Users\\tianx\\PycharmProjects\\virtualenv\\asr\\lib\\site-packages\\certifi\\cacert.pem'
|
| 156 |
+
2024-05-11 16:03:02,457 - PIL.Image - DEBUG Image.py:376 > Importing BlpImagePlugin
|
| 157 |
+
2024-05-11 16:03:02,458 - PIL.Image - DEBUG Image.py:376 > Importing BmpImagePlugin
|
| 158 |
+
2024-05-11 16:03:02,459 - PIL.Image - DEBUG Image.py:376 > Importing BufrStubImagePlugin
|
| 159 |
+
2024-05-11 16:03:02,459 - PIL.Image - DEBUG Image.py:376 > Importing CurImagePlugin
|
| 160 |
+
2024-05-11 16:03:02,460 - PIL.Image - DEBUG Image.py:376 > Importing DcxImagePlugin
|
| 161 |
+
2024-05-11 16:03:02,460 - PIL.Image - DEBUG Image.py:376 > Importing DdsImagePlugin
|
| 162 |
+
2024-05-11 16:03:02,463 - PIL.Image - DEBUG Image.py:376 > Importing EpsImagePlugin
|
| 163 |
+
2024-05-11 16:03:02,464 - PIL.Image - DEBUG Image.py:376 > Importing FitsImagePlugin
|
| 164 |
+
2024-05-11 16:03:02,464 - PIL.Image - DEBUG Image.py:376 > Importing FliImagePlugin
|
| 165 |
+
2024-05-11 16:03:02,465 - PIL.Image - DEBUG Image.py:376 > Importing FpxImagePlugin
|
| 166 |
+
2024-05-11 16:03:02,465 - PIL.Image - DEBUG Image.py:379 > Image: failed to import FpxImagePlugin: No module named 'olefile'
|
| 167 |
+
2024-05-11 16:03:02,465 - PIL.Image - DEBUG Image.py:376 > Importing FtexImagePlugin
|
| 168 |
+
2024-05-11 16:03:02,466 - PIL.Image - DEBUG Image.py:376 > Importing GbrImagePlugin
|
| 169 |
+
2024-05-11 16:03:02,466 - PIL.Image - DEBUG Image.py:376 > Importing GifImagePlugin
|
| 170 |
+
2024-05-11 16:03:02,468 - PIL.Image - DEBUG Image.py:376 > Importing GribStubImagePlugin
|
| 171 |
+
2024-05-11 16:03:02,468 - PIL.Image - DEBUG Image.py:376 > Importing Hdf5StubImagePlugin
|
| 172 |
+
2024-05-11 16:03:02,469 - PIL.Image - DEBUG Image.py:376 > Importing IcnsImagePlugin
|
| 173 |
+
2024-05-11 16:03:02,470 - PIL.Image - DEBUG Image.py:376 > Importing IcoImagePlugin
|
| 174 |
+
2024-05-11 16:03:02,470 - PIL.Image - DEBUG Image.py:376 > Importing ImImagePlugin
|
| 175 |
+
2024-05-11 16:03:02,471 - PIL.Image - DEBUG Image.py:376 > Importing ImtImagePlugin
|
| 176 |
+
2024-05-11 16:03:02,471 - PIL.Image - DEBUG Image.py:376 > Importing IptcImagePlugin
|
| 177 |
+
2024-05-11 16:03:02,472 - PIL.Image - DEBUG Image.py:376 > Importing JpegImagePlugin
|
| 178 |
+
2024-05-11 16:03:02,473 - PIL.Image - DEBUG Image.py:376 > Importing Jpeg2KImagePlugin
|
| 179 |
+
2024-05-11 16:03:02,473 - PIL.Image - DEBUG Image.py:376 > Importing McIdasImagePlugin
|
| 180 |
+
2024-05-11 16:03:02,473 - PIL.Image - DEBUG Image.py:376 > Importing MicImagePlugin
|
| 181 |
+
2024-05-11 16:03:02,474 - PIL.Image - DEBUG Image.py:379 > Image: failed to import MicImagePlugin: No module named 'olefile'
|
| 182 |
+
2024-05-11 16:03:02,474 - PIL.Image - DEBUG Image.py:376 > Importing MpegImagePlugin
|
| 183 |
+
2024-05-11 16:03:02,475 - PIL.Image - DEBUG Image.py:376 > Importing MpoImagePlugin
|
| 184 |
+
2024-05-11 16:03:02,476 - PIL.Image - DEBUG Image.py:376 > Importing MspImagePlugin
|
| 185 |
+
2024-05-11 16:03:02,476 - PIL.Image - DEBUG Image.py:376 > Importing PalmImagePlugin
|
| 186 |
+
2024-05-11 16:03:02,477 - PIL.Image - DEBUG Image.py:376 > Importing PcdImagePlugin
|
| 187 |
+
2024-05-11 16:03:02,477 - PIL.Image - DEBUG Image.py:376 > Importing PcxImagePlugin
|
| 188 |
+
2024-05-11 16:03:02,477 - PIL.Image - DEBUG Image.py:376 > Importing PdfImagePlugin
|
| 189 |
+
2024-05-11 16:03:02,477 - httpcore.connection - DEBUG _trace.py:45 > connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x000002990A7CB6A0>
|
| 190 |
+
2024-05-11 16:03:02,477 - httpcore.connection - DEBUG _trace.py:45 > start_tls.started ssl_context=<ssl.SSLContext object at 0x000002990A066DC0> server_hostname='api.gradio.app' timeout=3
|
| 191 |
+
2024-05-11 16:03:02,482 - PIL.Image - DEBUG Image.py:376 > Importing PixarImagePlugin
|
| 192 |
+
2024-05-11 16:03:02,483 - PIL.Image - DEBUG Image.py:376 > Importing PngImagePlugin
|
| 193 |
+
2024-05-11 16:03:02,483 - PIL.Image - DEBUG Image.py:376 > Importing PpmImagePlugin
|
| 194 |
+
2024-05-11 16:03:02,484 - PIL.Image - DEBUG Image.py:376 > Importing PsdImagePlugin
|
| 195 |
+
2024-05-11 16:03:02,484 - PIL.Image - DEBUG Image.py:376 > Importing QoiImagePlugin
|
| 196 |
+
2024-05-11 16:03:02,485 - PIL.Image - DEBUG Image.py:376 > Importing SgiImagePlugin
|
| 197 |
+
2024-05-11 16:03:02,485 - PIL.Image - DEBUG Image.py:376 > Importing SpiderImagePlugin
|
| 198 |
+
2024-05-11 16:03:02,485 - PIL.Image - DEBUG Image.py:376 > Importing SunImagePlugin
|
| 199 |
+
2024-05-11 16:03:02,486 - PIL.Image - DEBUG Image.py:376 > Importing TgaImagePlugin
|
| 200 |
+
2024-05-11 16:03:02,486 - PIL.Image - DEBUG Image.py:376 > Importing TiffImagePlugin
|
| 201 |
+
2024-05-11 16:03:02,486 - PIL.Image - DEBUG Image.py:376 > Importing WebPImagePlugin
|
| 202 |
+
2024-05-11 16:03:02,487 - PIL.Image - DEBUG Image.py:376 > Importing WmfImagePlugin
|
| 203 |
+
2024-05-11 16:03:02,487 - PIL.Image - DEBUG Image.py:376 > Importing XbmImagePlugin
|
| 204 |
+
2024-05-11 16:03:02,488 - PIL.Image - DEBUG Image.py:376 > Importing XpmImagePlugin
|
| 205 |
+
2024-05-11 16:03:02,489 - PIL.Image - DEBUG Image.py:376 > Importing XVThumbImagePlugin
|
| 206 |
+
2024-05-11 16:03:02,822 - httpcore.connection - DEBUG _trace.py:45 > start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x000002990A7CB4F0>
|
| 207 |
+
2024-05-11 16:03:02,822 - httpcore.http11 - DEBUG _trace.py:45 > send_request_headers.started request=<Request [b'GET']>
|
| 208 |
+
2024-05-11 16:03:02,825 - httpcore.http11 - DEBUG _trace.py:45 > send_request_headers.complete
|
| 209 |
+
2024-05-11 16:03:02,826 - httpcore.http11 - DEBUG _trace.py:45 > send_request_body.started request=<Request [b'GET']>
|
| 210 |
+
2024-05-11 16:03:02,826 - httpcore.http11 - DEBUG _trace.py:45 > send_request_body.complete
|
| 211 |
+
2024-05-11 16:03:02,826 - httpcore.http11 - DEBUG _trace.py:45 > receive_response_headers.started request=<Request [b'GET']>
|
| 212 |
+
2024-05-11 16:03:02,991 - httpcore.http11 - DEBUG _trace.py:45 > receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Sat, 11 May 2024 08:03:02 GMT'), (b'Content-Type', b'application/json'), (b'Content-Length', b'3'), (b'Connection', b'keep-alive'), (b'Server', b'nginx/1.18.0'), (b'Access-Control-Allow-Origin', b'*')])
|
| 213 |
+
2024-05-11 16:03:02,992 - httpx - INFO _client.py:1026 > HTTP Request: GET https://api.gradio.app/gradio-messaging/en "HTTP/1.1 200 OK"
|
| 214 |
+
2024-05-11 16:03:02,992 - httpcore.http11 - DEBUG _trace.py:45 > receive_response_body.started request=<Request [b'GET']>
|
| 215 |
+
2024-05-11 16:03:02,998 - httpcore.http11 - DEBUG _trace.py:45 > receive_response_body.complete
|
| 216 |
+
2024-05-11 16:03:02,998 - httpcore.http11 - DEBUG _trace.py:45 > response_closed.started
|
| 217 |
+
2024-05-11 16:03:02,998 - httpcore.http11 - DEBUG _trace.py:45 > response_closed.complete
|
| 218 |
+
2024-05-11 16:03:02,998 - httpcore.connection - DEBUG _trace.py:45 > close.started
|
| 219 |
+
2024-05-11 16:03:02,998 - httpcore.connection - DEBUG _trace.py:45 > close.complete
|
logs/error.log
ADDED
|
File without changes
|
logs/http.log
ADDED
|
File without changes
|
logs/info.log
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
2024-05-11 16:02:06,066 - httpx - INFO _client.py:1026 > HTTP Request: GET https://api.gradio.app/gradio-messaging/en "HTTP/1.1 200 OK"
|
| 2 |
+
2024-05-11 16:02:27,452 - httpx - INFO _client.py:1026 > HTTP Request: GET https://api.gradio.app/gradio-messaging/en "HTTP/1.1 200 OK"
|
| 3 |
+
2024-05-11 16:03:02,992 - httpx - INFO _client.py:1026 > HTTP Request: GET https://api.gradio.app/gradio-messaging/en "HTTP/1.1 200 OK"
|
logs/main.log
ADDED
|
File without changes
|
toolbox/k2_sherpa/decode.py
CHANGED
|
@@ -1,13 +1,14 @@
|
|
| 1 |
#!/usr/bin/python3
|
| 2 |
# -*- coding: utf-8 -*-
|
|
|
|
| 3 |
from typing import Union, Tuple
|
| 4 |
|
| 5 |
import numpy as np
|
| 6 |
-
import sherpa
|
| 7 |
-
import sherpa_onnx
|
| 8 |
import torch
|
| 9 |
import torchaudio
|
| 10 |
import wave
|
|
|
|
|
|
|
| 11 |
|
| 12 |
|
| 13 |
def read_wave(wave_filename: str) -> Tuple[np.ndarray, int]:
|
|
|
|
| 1 |
#!/usr/bin/python3
|
| 2 |
# -*- coding: utf-8 -*-
|
| 3 |
+
import platform
|
| 4 |
from typing import Union, Tuple
|
| 5 |
|
| 6 |
import numpy as np
|
|
|
|
|
|
|
| 7 |
import torch
|
| 8 |
import torchaudio
|
| 9 |
import wave
|
| 10 |
+
import sherpa
|
| 11 |
+
import sherpa_onnx
|
| 12 |
|
| 13 |
|
| 14 |
def read_wave(wave_filename: str) -> Tuple[np.ndarray, int]:
|
toolbox/k2_sherpa/nn_models.py
CHANGED
|
@@ -3,6 +3,7 @@
|
|
| 3 |
from enum import Enum
|
| 4 |
from functools import lru_cache
|
| 5 |
import os
|
|
|
|
| 6 |
from pathlib import Path
|
| 7 |
|
| 8 |
import huggingface_hub
|
|
@@ -23,8 +24,8 @@ model_map = {
|
|
| 23 |
"nn_model_file_sub_folder": ".",
|
| 24 |
"tokens_file": "units.txt",
|
| 25 |
"tokens_file_sub_folder": ".",
|
| 26 |
-
"loader": "load_sherpa_offline_recognizer",
|
| 27 |
"normalize_samples": False,
|
|
|
|
| 28 |
},
|
| 29 |
{
|
| 30 |
"repo_id": "csukuangfj/sherpa-onnx-paraformer-zh-2024-03-09",
|
|
@@ -48,8 +49,8 @@ model_map = {
|
|
| 48 |
"nn_model_file_sub_folder": "exp",
|
| 49 |
"tokens_file": "tokens.txt",
|
| 50 |
"tokens_file_sub_folder": "data/lang_char",
|
| 51 |
-
"loader": "load_sherpa_offline_recognizer",
|
| 52 |
"normalize_samples": True,
|
|
|
|
| 53 |
},
|
| 54 |
{
|
| 55 |
"repo_id": "zrjin/sherpa-onnx-zipformer-multi-zh-hans-2023-9-2",
|
|
@@ -97,28 +98,50 @@ model_map = {
|
|
| 97 |
}
|
| 98 |
|
| 99 |
|
| 100 |
-
def download_model(
|
| 101 |
-
|
| 102 |
-
nn_model_file_sub_folder: str,
|
| 103 |
-
tokens_file: str,
|
| 104 |
-
tokens_file_sub_folder: str,
|
| 105 |
-
local_model_dir: str,
|
| 106 |
):
|
|
|
|
| 107 |
|
| 108 |
-
nn_model_file
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
|
|
|
| 114 |
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
|
| 123 |
|
| 124 |
def load_sherpa_offline_recognizer(nn_model_file: str,
|
|
@@ -192,43 +215,49 @@ def load_sherpa_offline_recognizer_from_transducer(encoder_model_file: str,
|
|
| 192 |
return recognizer
|
| 193 |
|
| 194 |
|
| 195 |
-
def load_recognizer(
|
| 196 |
-
nn_model_file: str,
|
| 197 |
-
nn_model_file_sub_folder: str,
|
| 198 |
-
tokens_file: str,
|
| 199 |
-
tokens_file_sub_folder: str,
|
| 200 |
-
local_model_dir: Path,
|
| 201 |
-
loader: str,
|
| 202 |
decoding_method: str = "greedy_search",
|
| 203 |
num_active_paths: int = 4,
|
| 204 |
-
|
| 205 |
):
|
| 206 |
if not os.path.exists(local_model_dir):
|
| 207 |
download_model(
|
| 208 |
-
repo_id=repo_id,
|
| 209 |
-
nn_model_file=nn_model_file,
|
| 210 |
-
nn_model_file_sub_folder=nn_model_file_sub_folder,
|
| 211 |
-
tokens_file=tokens_file,
|
| 212 |
-
tokens_file_sub_folder=tokens_file_sub_folder,
|
| 213 |
local_model_dir=local_model_dir.as_posix(),
|
|
|
|
| 214 |
)
|
| 215 |
|
| 216 |
-
|
| 217 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 218 |
|
| 219 |
if loader == "load_sherpa_offline_recognizer":
|
| 220 |
recognizer = load_sherpa_offline_recognizer(
|
| 221 |
-
nn_model_file=nn_model_file,
|
| 222 |
-
tokens_file=tokens_file,
|
| 223 |
decoding_method=decoding_method,
|
| 224 |
num_active_paths=num_active_paths,
|
| 225 |
-
|
| 226 |
)
|
| 227 |
elif loader == "load_sherpa_offline_recognizer_from_paraformer":
|
| 228 |
recognizer = load_sherpa_offline_recognizer_from_paraformer(
|
| 229 |
-
nn_model_file=nn_model_file,
|
| 230 |
-
tokens_file=tokens_file,
|
| 231 |
decoding_method=decoding_method,
|
|
|
|
| 232 |
)
|
| 233 |
else:
|
| 234 |
raise NotImplementedError("loader not support: {}".format(loader))
|
|
|
|
| 3 |
from enum import Enum
|
| 4 |
from functools import lru_cache
|
| 5 |
import os
|
| 6 |
+
import platform
|
| 7 |
from pathlib import Path
|
| 8 |
|
| 9 |
import huggingface_hub
|
|
|
|
| 24 |
"nn_model_file_sub_folder": ".",
|
| 25 |
"tokens_file": "units.txt",
|
| 26 |
"tokens_file_sub_folder": ".",
|
|
|
|
| 27 |
"normalize_samples": False,
|
| 28 |
+
"loader": "load_sherpa_offline_recognizer",
|
| 29 |
},
|
| 30 |
{
|
| 31 |
"repo_id": "csukuangfj/sherpa-onnx-paraformer-zh-2024-03-09",
|
|
|
|
| 49 |
"nn_model_file_sub_folder": "exp",
|
| 50 |
"tokens_file": "tokens.txt",
|
| 51 |
"tokens_file_sub_folder": "data/lang_char",
|
|
|
|
| 52 |
"normalize_samples": True,
|
| 53 |
+
"loader": "load_sherpa_offline_recognizer",
|
| 54 |
},
|
| 55 |
{
|
| 56 |
"repo_id": "zrjin/sherpa-onnx-zipformer-multi-zh-hans-2023-9-2",
|
|
|
|
| 98 |
}
|
| 99 |
|
| 100 |
|
| 101 |
+
def download_model(local_model_dir: str,
|
| 102 |
+
**kwargs,
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
):
|
| 104 |
+
repo_id = kwargs["repo_id"]
|
| 105 |
|
| 106 |
+
if "nn_model_file" in kwargs.keys():
|
| 107 |
+
_ = huggingface_hub.hf_hub_download(
|
| 108 |
+
repo_id=repo_id,
|
| 109 |
+
filename=kwargs["nn_model_file"],
|
| 110 |
+
subfolder=kwargs["nn_model_file_sub_folder"],
|
| 111 |
+
local_dir=local_model_dir,
|
| 112 |
+
)
|
| 113 |
|
| 114 |
+
if "encoder_model_file" in kwargs.keys():
|
| 115 |
+
_ = huggingface_hub.hf_hub_download(
|
| 116 |
+
repo_id=repo_id,
|
| 117 |
+
filename=kwargs["encoder_model_file"],
|
| 118 |
+
subfolder=kwargs["encoder_model_file_sub_folder"],
|
| 119 |
+
local_dir=local_model_dir,
|
| 120 |
+
)
|
| 121 |
+
|
| 122 |
+
if "decoder_model_file" in kwargs.keys():
|
| 123 |
+
_ = huggingface_hub.hf_hub_download(
|
| 124 |
+
repo_id=repo_id,
|
| 125 |
+
filename=kwargs["decoder_model_file"],
|
| 126 |
+
subfolder=kwargs["decoder_model_file_sub_folder"],
|
| 127 |
+
local_dir=local_model_dir,
|
| 128 |
+
)
|
| 129 |
+
|
| 130 |
+
if "joiner_model_file" in kwargs.keys():
|
| 131 |
+
_ = huggingface_hub.hf_hub_download(
|
| 132 |
+
repo_id=repo_id,
|
| 133 |
+
filename=kwargs["joiner_model_file"],
|
| 134 |
+
subfolder=kwargs["joiner_model_file_sub_folder"],
|
| 135 |
+
local_dir=local_model_dir,
|
| 136 |
+
)
|
| 137 |
+
|
| 138 |
+
if "tokens_file" in kwargs.keys():
|
| 139 |
+
_ = huggingface_hub.hf_hub_download(
|
| 140 |
+
repo_id=repo_id,
|
| 141 |
+
filename=kwargs["tokens_file"],
|
| 142 |
+
subfolder=kwargs["tokens_file_sub_folder"],
|
| 143 |
+
local_dir=local_model_dir,
|
| 144 |
+
)
|
| 145 |
|
| 146 |
|
| 147 |
def load_sherpa_offline_recognizer(nn_model_file: str,
|
|
|
|
| 215 |
return recognizer
|
| 216 |
|
| 217 |
|
| 218 |
+
def load_recognizer(local_model_dir: Path,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 219 |
decoding_method: str = "greedy_search",
|
| 220 |
num_active_paths: int = 4,
|
| 221 |
+
**kwargs
|
| 222 |
):
|
| 223 |
if not os.path.exists(local_model_dir):
|
| 224 |
download_model(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 225 |
local_model_dir=local_model_dir.as_posix(),
|
| 226 |
+
**kwargs,
|
| 227 |
)
|
| 228 |
|
| 229 |
+
loader = kwargs["loader"]
|
| 230 |
+
|
| 231 |
+
kwargs_ = dict()
|
| 232 |
+
if "nn_model_file" in kwargs.keys():
|
| 233 |
+
nn_model_file = (local_model_dir / kwargs["nn_model_file"]).as_posix()
|
| 234 |
+
kwargs_["nn_model_file"] = nn_model_file
|
| 235 |
+
if "encoder_model_file" in kwargs.keys():
|
| 236 |
+
encoder_model_file = (local_model_dir / kwargs["encoder_model_file"]).as_posix()
|
| 237 |
+
kwargs_["encoder_model_file"] = encoder_model_file
|
| 238 |
+
if "decoder_model_file" in kwargs.keys():
|
| 239 |
+
decoder_model_file = (local_model_dir / kwargs["decoder_model_file"]).as_posix()
|
| 240 |
+
kwargs_["decoder_model_file"] = decoder_model_file
|
| 241 |
+
if "joiner_model_file" in kwargs.keys():
|
| 242 |
+
joiner_model_file = (local_model_dir / kwargs["joiner_model_file"]).as_posix()
|
| 243 |
+
kwargs_["joiner_model_file"] = joiner_model_file
|
| 244 |
+
if "tokens_file" in kwargs.keys():
|
| 245 |
+
tokens_file = (local_model_dir / kwargs["tokens_file"]).as_posix()
|
| 246 |
+
kwargs_["tokens_file"] = tokens_file
|
| 247 |
+
|
| 248 |
+
if "normalize_samples" in kwargs.keys():
|
| 249 |
+
kwargs_["normalize_samples"] = kwargs["normalize_samples"]
|
| 250 |
|
| 251 |
if loader == "load_sherpa_offline_recognizer":
|
| 252 |
recognizer = load_sherpa_offline_recognizer(
|
|
|
|
|
|
|
| 253 |
decoding_method=decoding_method,
|
| 254 |
num_active_paths=num_active_paths,
|
| 255 |
+
**kwargs_
|
| 256 |
)
|
| 257 |
elif loader == "load_sherpa_offline_recognizer_from_paraformer":
|
| 258 |
recognizer = load_sherpa_offline_recognizer_from_paraformer(
|
|
|
|
|
|
|
| 259 |
decoding_method=decoding_method,
|
| 260 |
+
**kwargs_
|
| 261 |
)
|
| 262 |
else:
|
| 263 |
raise NotImplementedError("loader not support: {}".format(loader))
|