Spaces:
Runtime error
Runtime error
Commit
·
7bfa718
1
Parent(s):
cfcc77d
Upload files
Browse files- .gitignore +553 -0
- .vscode/settings.json +5 -0
- app.py +70 -0
- example1.wav +0 -0
- example2.mp3 +0 -0
- example3.mp3 +0 -0
- example4.wav +0 -0
- packages.txt +1 -0
- requirements.txt +7 -0
.gitignore
ADDED
@@ -0,0 +1,553 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
# Created by https://www.toptal.com/developers/gitignore/api/visualstudio,visualstudiocode,metals,python
|
3 |
+
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudio,visualstudiocode,metals,python
|
4 |
+
|
5 |
+
### Metals ###
|
6 |
+
.metals/
|
7 |
+
.bloop/
|
8 |
+
project/**/metals.sbt
|
9 |
+
|
10 |
+
### Python ###
|
11 |
+
# Byte-compiled / optimized / DLL files
|
12 |
+
__pycache__/
|
13 |
+
*.py[cod]
|
14 |
+
*$py.class
|
15 |
+
|
16 |
+
# C extensions
|
17 |
+
*.so
|
18 |
+
|
19 |
+
# Distribution / packaging
|
20 |
+
.Python
|
21 |
+
build/
|
22 |
+
develop-eggs/
|
23 |
+
dist/
|
24 |
+
downloads/
|
25 |
+
eggs/
|
26 |
+
.eggs/
|
27 |
+
lib/
|
28 |
+
lib64/
|
29 |
+
parts/
|
30 |
+
sdist/
|
31 |
+
var/
|
32 |
+
wheels/
|
33 |
+
share/python-wheels/
|
34 |
+
*.egg-info/
|
35 |
+
.installed.cfg
|
36 |
+
*.egg
|
37 |
+
MANIFEST
|
38 |
+
|
39 |
+
# PyInstaller
|
40 |
+
# Usually these files are written by a python script from a template
|
41 |
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
42 |
+
*.manifest
|
43 |
+
*.spec
|
44 |
+
|
45 |
+
# Installer logs
|
46 |
+
pip-log.txt
|
47 |
+
pip-delete-this-directory.txt
|
48 |
+
|
49 |
+
# Unit test / coverage reports
|
50 |
+
htmlcov/
|
51 |
+
.tox/
|
52 |
+
.nox/
|
53 |
+
.coverage
|
54 |
+
.coverage.*
|
55 |
+
.cache
|
56 |
+
nosetests.xml
|
57 |
+
coverage.xml
|
58 |
+
*.cover
|
59 |
+
*.py,cover
|
60 |
+
.hypothesis/
|
61 |
+
.pytest_cache/
|
62 |
+
cover/
|
63 |
+
|
64 |
+
# Translations
|
65 |
+
*.mo
|
66 |
+
*.pot
|
67 |
+
|
68 |
+
# Django stuff:
|
69 |
+
*.log
|
70 |
+
local_settings.py
|
71 |
+
db.sqlite3
|
72 |
+
db.sqlite3-journal
|
73 |
+
|
74 |
+
# Flask stuff:
|
75 |
+
instance/
|
76 |
+
.webassets-cache
|
77 |
+
|
78 |
+
# Scrapy stuff:
|
79 |
+
.scrapy
|
80 |
+
|
81 |
+
# Sphinx documentation
|
82 |
+
docs/_build/
|
83 |
+
|
84 |
+
# PyBuilder
|
85 |
+
.pybuilder/
|
86 |
+
target/
|
87 |
+
|
88 |
+
# Jupyter Notebook
|
89 |
+
.ipynb_checkpoints
|
90 |
+
|
91 |
+
# IPython
|
92 |
+
profile_default/
|
93 |
+
ipython_config.py
|
94 |
+
|
95 |
+
# pyenv
|
96 |
+
# For a library or package, you might want to ignore these files since the code is
|
97 |
+
# intended to run in multiple environments; otherwise, check them in:
|
98 |
+
# .python-version
|
99 |
+
|
100 |
+
# pipenv
|
101 |
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
102 |
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
103 |
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
104 |
+
# install all needed dependencies.
|
105 |
+
#Pipfile.lock
|
106 |
+
|
107 |
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
108 |
+
__pypackages__/
|
109 |
+
|
110 |
+
# Celery stuff
|
111 |
+
celerybeat-schedule
|
112 |
+
celerybeat.pid
|
113 |
+
|
114 |
+
# SageMath parsed files
|
115 |
+
*.sage.py
|
116 |
+
|
117 |
+
# Environments
|
118 |
+
.env
|
119 |
+
.venv
|
120 |
+
env/
|
121 |
+
venv/
|
122 |
+
ENV/
|
123 |
+
env.bak/
|
124 |
+
venv.bak/
|
125 |
+
|
126 |
+
# Spyder project settings
|
127 |
+
.spyderproject
|
128 |
+
.spyproject
|
129 |
+
|
130 |
+
# Rope project settings
|
131 |
+
.ropeproject
|
132 |
+
|
133 |
+
# mkdocs documentation
|
134 |
+
/site
|
135 |
+
|
136 |
+
# mypy
|
137 |
+
.mypy_cache/
|
138 |
+
.dmypy.json
|
139 |
+
dmypy.json
|
140 |
+
|
141 |
+
# Pyre type checker
|
142 |
+
.pyre/
|
143 |
+
|
144 |
+
# pytype static type analyzer
|
145 |
+
.pytype/
|
146 |
+
|
147 |
+
# Cython debug symbols
|
148 |
+
cython_debug/
|
149 |
+
|
150 |
+
### VisualStudioCode ###
|
151 |
+
.vscode/*
|
152 |
+
!.vscode/settings.json
|
153 |
+
!.vscode/tasks.json
|
154 |
+
!.vscode/launch.json
|
155 |
+
!.vscode/extensions.json
|
156 |
+
*.code-workspace
|
157 |
+
|
158 |
+
# Local History for Visual Studio Code
|
159 |
+
.history/
|
160 |
+
|
161 |
+
### VisualStudioCode Patch ###
|
162 |
+
# Ignore all local history of files
|
163 |
+
.history
|
164 |
+
.ionide
|
165 |
+
|
166 |
+
# Support for Project snippet scope
|
167 |
+
!.vscode/*.code-snippets
|
168 |
+
|
169 |
+
### VisualStudio ###
|
170 |
+
## Ignore Visual Studio temporary files, build results, and
|
171 |
+
## files generated by popular Visual Studio add-ons.
|
172 |
+
##
|
173 |
+
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
174 |
+
|
175 |
+
# User-specific files
|
176 |
+
*.rsuser
|
177 |
+
*.suo
|
178 |
+
*.user
|
179 |
+
*.userosscache
|
180 |
+
*.sln.docstates
|
181 |
+
|
182 |
+
# User-specific files (MonoDevelop/Xamarin Studio)
|
183 |
+
*.userprefs
|
184 |
+
|
185 |
+
# Mono auto generated files
|
186 |
+
mono_crash.*
|
187 |
+
|
188 |
+
# Build results
|
189 |
+
[Dd]ebug/
|
190 |
+
[Dd]ebugPublic/
|
191 |
+
[Rr]elease/
|
192 |
+
[Rr]eleases/
|
193 |
+
x64/
|
194 |
+
x86/
|
195 |
+
[Ww][Ii][Nn]32/
|
196 |
+
[Aa][Rr][Mm]/
|
197 |
+
[Aa][Rr][Mm]64/
|
198 |
+
bld/
|
199 |
+
[Bb]in/
|
200 |
+
[Oo]bj/
|
201 |
+
[Ll]og/
|
202 |
+
[Ll]ogs/
|
203 |
+
|
204 |
+
# Visual Studio 2015/2017 cache/options directory
|
205 |
+
.vs/
|
206 |
+
# Uncomment if you have tasks that create the project's static files in wwwroot
|
207 |
+
#wwwroot/
|
208 |
+
|
209 |
+
# Visual Studio 2017 auto generated files
|
210 |
+
Generated\ Files/
|
211 |
+
|
212 |
+
# MSTest test Results
|
213 |
+
[Tt]est[Rr]esult*/
|
214 |
+
[Bb]uild[Ll]og.*
|
215 |
+
|
216 |
+
# NUnit
|
217 |
+
*.VisualState.xml
|
218 |
+
TestResult.xml
|
219 |
+
nunit-*.xml
|
220 |
+
|
221 |
+
# Build Results of an ATL Project
|
222 |
+
[Dd]ebugPS/
|
223 |
+
[Rr]eleasePS/
|
224 |
+
dlldata.c
|
225 |
+
|
226 |
+
# Benchmark Results
|
227 |
+
BenchmarkDotNet.Artifacts/
|
228 |
+
|
229 |
+
# .NET Core
|
230 |
+
project.lock.json
|
231 |
+
project.fragment.lock.json
|
232 |
+
artifacts/
|
233 |
+
|
234 |
+
# ASP.NET Scaffolding
|
235 |
+
ScaffoldingReadMe.txt
|
236 |
+
|
237 |
+
# StyleCop
|
238 |
+
StyleCopReport.xml
|
239 |
+
|
240 |
+
# Files built by Visual Studio
|
241 |
+
*_i.c
|
242 |
+
*_p.c
|
243 |
+
*_h.h
|
244 |
+
*.ilk
|
245 |
+
*.meta
|
246 |
+
*.obj
|
247 |
+
*.iobj
|
248 |
+
*.pch
|
249 |
+
*.pdb
|
250 |
+
*.ipdb
|
251 |
+
*.pgc
|
252 |
+
*.pgd
|
253 |
+
*.rsp
|
254 |
+
*.sbr
|
255 |
+
*.tlb
|
256 |
+
*.tli
|
257 |
+
*.tlh
|
258 |
+
*.tmp
|
259 |
+
*.tmp_proj
|
260 |
+
*_wpftmp.csproj
|
261 |
+
*.tlog
|
262 |
+
*.vspscc
|
263 |
+
*.vssscc
|
264 |
+
.builds
|
265 |
+
*.pidb
|
266 |
+
*.svclog
|
267 |
+
*.scc
|
268 |
+
|
269 |
+
# Chutzpah Test files
|
270 |
+
_Chutzpah*
|
271 |
+
|
272 |
+
# Visual C++ cache files
|
273 |
+
ipch/
|
274 |
+
*.aps
|
275 |
+
*.ncb
|
276 |
+
*.opendb
|
277 |
+
*.opensdf
|
278 |
+
*.sdf
|
279 |
+
*.cachefile
|
280 |
+
*.VC.db
|
281 |
+
*.VC.VC.opendb
|
282 |
+
|
283 |
+
# Visual Studio profiler
|
284 |
+
*.psess
|
285 |
+
*.vsp
|
286 |
+
*.vspx
|
287 |
+
*.sap
|
288 |
+
|
289 |
+
# Visual Studio Trace Files
|
290 |
+
*.e2e
|
291 |
+
|
292 |
+
# TFS 2012 Local Workspace
|
293 |
+
$tf/
|
294 |
+
|
295 |
+
# Guidance Automation Toolkit
|
296 |
+
*.gpState
|
297 |
+
|
298 |
+
# ReSharper is a .NET coding add-in
|
299 |
+
_ReSharper*/
|
300 |
+
*.[Rr]e[Ss]harper
|
301 |
+
*.DotSettings.user
|
302 |
+
|
303 |
+
# TeamCity is a build add-in
|
304 |
+
_TeamCity*
|
305 |
+
|
306 |
+
# DotCover is a Code Coverage Tool
|
307 |
+
*.dotCover
|
308 |
+
|
309 |
+
# AxoCover is a Code Coverage Tool
|
310 |
+
.axoCover/*
|
311 |
+
!.axoCover/settings.json
|
312 |
+
|
313 |
+
# Coverlet is a free, cross platform Code Coverage Tool
|
314 |
+
coverage*.json
|
315 |
+
coverage*.xml
|
316 |
+
coverage*.info
|
317 |
+
|
318 |
+
# Visual Studio code coverage results
|
319 |
+
*.coverage
|
320 |
+
*.coveragexml
|
321 |
+
|
322 |
+
# NCrunch
|
323 |
+
_NCrunch_*
|
324 |
+
.*crunch*.local.xml
|
325 |
+
nCrunchTemp_*
|
326 |
+
|
327 |
+
# MightyMoose
|
328 |
+
*.mm.*
|
329 |
+
AutoTest.Net/
|
330 |
+
|
331 |
+
# Web workbench (sass)
|
332 |
+
.sass-cache/
|
333 |
+
|
334 |
+
# Installshield output folder
|
335 |
+
[Ee]xpress/
|
336 |
+
|
337 |
+
# DocProject is a documentation generator add-in
|
338 |
+
DocProject/buildhelp/
|
339 |
+
DocProject/Help/*.HxT
|
340 |
+
DocProject/Help/*.HxC
|
341 |
+
DocProject/Help/*.hhc
|
342 |
+
DocProject/Help/*.hhk
|
343 |
+
DocProject/Help/*.hhp
|
344 |
+
DocProject/Help/Html2
|
345 |
+
DocProject/Help/html
|
346 |
+
|
347 |
+
# Click-Once directory
|
348 |
+
publish/
|
349 |
+
|
350 |
+
# Publish Web Output
|
351 |
+
*.[Pp]ublish.xml
|
352 |
+
*.azurePubxml
|
353 |
+
# Note: Comment the next line if you want to checkin your web deploy settings,
|
354 |
+
# but database connection strings (with potential passwords) will be unencrypted
|
355 |
+
*.pubxml
|
356 |
+
*.publishproj
|
357 |
+
|
358 |
+
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
359 |
+
# checkin your Azure Web App publish settings, but sensitive information contained
|
360 |
+
# in these scripts will be unencrypted
|
361 |
+
PublishScripts/
|
362 |
+
|
363 |
+
# NuGet Packages
|
364 |
+
*.nupkg
|
365 |
+
# NuGet Symbol Packages
|
366 |
+
*.snupkg
|
367 |
+
# The packages folder can be ignored because of Package Restore
|
368 |
+
**/[Pp]ackages/*
|
369 |
+
# except build/, which is used as an MSBuild target.
|
370 |
+
!**/[Pp]ackages/build/
|
371 |
+
# Uncomment if necessary however generally it will be regenerated when needed
|
372 |
+
#!**/[Pp]ackages/repositories.config
|
373 |
+
# NuGet v3's project.json files produces more ignorable files
|
374 |
+
*.nuget.props
|
375 |
+
*.nuget.targets
|
376 |
+
|
377 |
+
# Nuget personal access tokens and Credentials
|
378 |
+
# nuget.config
|
379 |
+
|
380 |
+
# Microsoft Azure Build Output
|
381 |
+
csx/
|
382 |
+
*.build.csdef
|
383 |
+
|
384 |
+
# Microsoft Azure Emulator
|
385 |
+
ecf/
|
386 |
+
rcf/
|
387 |
+
|
388 |
+
# Windows Store app package directories and files
|
389 |
+
AppPackages/
|
390 |
+
BundleArtifacts/
|
391 |
+
Package.StoreAssociation.xml
|
392 |
+
_pkginfo.txt
|
393 |
+
*.appx
|
394 |
+
*.appxbundle
|
395 |
+
*.appxupload
|
396 |
+
|
397 |
+
# Visual Studio cache files
|
398 |
+
# files ending in .cache can be ignored
|
399 |
+
*.[Cc]ache
|
400 |
+
# but keep track of directories ending in .cache
|
401 |
+
!?*.[Cc]ache/
|
402 |
+
|
403 |
+
# Others
|
404 |
+
ClientBin/
|
405 |
+
~$*
|
406 |
+
*~
|
407 |
+
*.dbmdl
|
408 |
+
*.dbproj.schemaview
|
409 |
+
*.jfm
|
410 |
+
*.pfx
|
411 |
+
*.publishsettings
|
412 |
+
orleans.codegen.cs
|
413 |
+
|
414 |
+
# Including strong name files can present a security risk
|
415 |
+
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
416 |
+
#*.snk
|
417 |
+
|
418 |
+
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
419 |
+
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
420 |
+
#bower_components/
|
421 |
+
|
422 |
+
# RIA/Silverlight projects
|
423 |
+
Generated_Code/
|
424 |
+
|
425 |
+
# Backup & report files from converting an old project file
|
426 |
+
# to a newer Visual Studio version. Backup files are not needed,
|
427 |
+
# because we have git ;-)
|
428 |
+
_UpgradeReport_Files/
|
429 |
+
Backup*/
|
430 |
+
UpgradeLog*.XML
|
431 |
+
UpgradeLog*.htm
|
432 |
+
ServiceFabricBackup/
|
433 |
+
*.rptproj.bak
|
434 |
+
|
435 |
+
# SQL Server files
|
436 |
+
*.mdf
|
437 |
+
*.ldf
|
438 |
+
*.ndf
|
439 |
+
|
440 |
+
# Business Intelligence projects
|
441 |
+
*.rdl.data
|
442 |
+
*.bim.layout
|
443 |
+
*.bim_*.settings
|
444 |
+
*.rptproj.rsuser
|
445 |
+
*- [Bb]ackup.rdl
|
446 |
+
*- [Bb]ackup ([0-9]).rdl
|
447 |
+
*- [Bb]ackup ([0-9][0-9]).rdl
|
448 |
+
|
449 |
+
# Microsoft Fakes
|
450 |
+
FakesAssemblies/
|
451 |
+
|
452 |
+
# GhostDoc plugin setting file
|
453 |
+
*.GhostDoc.xml
|
454 |
+
|
455 |
+
# Node.js Tools for Visual Studio
|
456 |
+
.ntvs_analysis.dat
|
457 |
+
node_modules/
|
458 |
+
|
459 |
+
# Visual Studio 6 build log
|
460 |
+
*.plg
|
461 |
+
|
462 |
+
# Visual Studio 6 workspace options file
|
463 |
+
*.opt
|
464 |
+
|
465 |
+
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
466 |
+
*.vbw
|
467 |
+
|
468 |
+
# Visual Studio LightSwitch build output
|
469 |
+
**/*.HTMLClient/GeneratedArtifacts
|
470 |
+
**/*.DesktopClient/GeneratedArtifacts
|
471 |
+
**/*.DesktopClient/ModelManifest.xml
|
472 |
+
**/*.Server/GeneratedArtifacts
|
473 |
+
**/*.Server/ModelManifest.xml
|
474 |
+
_Pvt_Extensions
|
475 |
+
|
476 |
+
# Paket dependency manager
|
477 |
+
.paket/paket.exe
|
478 |
+
paket-files/
|
479 |
+
|
480 |
+
# FAKE - F# Make
|
481 |
+
.fake/
|
482 |
+
|
483 |
+
# CodeRush personal settings
|
484 |
+
.cr/personal
|
485 |
+
|
486 |
+
# Python Tools for Visual Studio (PTVS)
|
487 |
+
*.pyc
|
488 |
+
|
489 |
+
# Cake - Uncomment if you are using it
|
490 |
+
# tools/**
|
491 |
+
# !tools/packages.config
|
492 |
+
|
493 |
+
# Tabs Studio
|
494 |
+
*.tss
|
495 |
+
|
496 |
+
# Telerik's JustMock configuration file
|
497 |
+
*.jmconfig
|
498 |
+
|
499 |
+
# BizTalk build output
|
500 |
+
*.btp.cs
|
501 |
+
*.btm.cs
|
502 |
+
*.odx.cs
|
503 |
+
*.xsd.cs
|
504 |
+
|
505 |
+
# OpenCover UI analysis results
|
506 |
+
OpenCover/
|
507 |
+
|
508 |
+
# Azure Stream Analytics local run output
|
509 |
+
ASALocalRun/
|
510 |
+
|
511 |
+
# MSBuild Binary and Structured Log
|
512 |
+
*.binlog
|
513 |
+
|
514 |
+
# NVidia Nsight GPU debugger configuration file
|
515 |
+
*.nvuser
|
516 |
+
|
517 |
+
# MFractors (Xamarin productivity tool) working folder
|
518 |
+
.mfractor/
|
519 |
+
|
520 |
+
# Local History for Visual Studio
|
521 |
+
.localhistory/
|
522 |
+
|
523 |
+
# BeatPulse healthcheck temp database
|
524 |
+
healthchecksdb
|
525 |
+
|
526 |
+
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
527 |
+
MigrationBackup/
|
528 |
+
|
529 |
+
# Ionide (cross platform F# VS Code tools) working folder
|
530 |
+
.ionide/
|
531 |
+
|
532 |
+
# Fody - auto-generated XML schema
|
533 |
+
FodyWeavers.xsd
|
534 |
+
|
535 |
+
# VS Code files for those working on multiple tools
|
536 |
+
|
537 |
+
# Local History for Visual Studio Code
|
538 |
+
|
539 |
+
# Windows Installer files from build outputs
|
540 |
+
*.cab
|
541 |
+
*.msi
|
542 |
+
*.msix
|
543 |
+
*.msm
|
544 |
+
*.msp
|
545 |
+
|
546 |
+
# JetBrains Rider
|
547 |
+
.idea/
|
548 |
+
*.sln.iml
|
549 |
+
|
550 |
+
### VisualStudio Patch ###
|
551 |
+
# Additional files built by Visual Studio
|
552 |
+
|
553 |
+
# End of https://www.toptal.com/developers/gitignore/api/visualstudio,visualstudiocode,metals,python
|
.vscode/settings.json
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"files.watcherExclude": {
|
3 |
+
"**/target": true
|
4 |
+
}
|
5 |
+
}
|
app.py
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import torch
|
3 |
+
import zipfile
|
4 |
+
from pyctcdecode import build_ctcdecoder
|
5 |
+
from speechbrain.pretrained import EncoderASR
|
6 |
+
from transformers.file_utils import cached_path, hf_bucket_url
|
7 |
+
|
8 |
+
cache_dir = './cache/'
|
9 |
+
lm_file = hf_bucket_url("dragonSwing/wav2vec2-base-vn-270h", filename='4gram.zip')
|
10 |
+
lm_file = cached_path(lm_file, cache_dir=cache_dir)
|
11 |
+
with zipfile.ZipFile(lm_file, 'r') as zip_ref:
|
12 |
+
zip_ref.extractall(cache_dir)
|
13 |
+
lm_file = cache_dir + 'lm.binary'
|
14 |
+
vocab_file = cache_dir + 'vocab-260000.txt'
|
15 |
+
model = EncoderASR.from_hparams(source="dragonSwing/wav2vec2-base-vn-270h",
|
16 |
+
savedir="/content/pretrained2/"
|
17 |
+
)
|
18 |
+
|
19 |
+
def get_decoder_ngram_model(tokenizer, ngram_lm_path, vocab_path=None):
|
20 |
+
unigrams = None
|
21 |
+
if vocab_path is not None:
|
22 |
+
unigrams = []
|
23 |
+
with open(vocab_path, encoding='utf-8') as f:
|
24 |
+
for line in f:
|
25 |
+
unigrams.append(line.strip())
|
26 |
+
|
27 |
+
vocab_dict = tokenizer.get_vocab()
|
28 |
+
sort_vocab = sorted((value, key) for (key, value) in vocab_dict.items())
|
29 |
+
vocab = [x[1] for x in sort_vocab]
|
30 |
+
vocab_list = vocab
|
31 |
+
|
32 |
+
# convert ctc blank character representation
|
33 |
+
vocab_list[tokenizer.pad_token_id] = ""
|
34 |
+
# replace special characters
|
35 |
+
vocab_list[tokenizer.word_delimiter_token_id] = " "
|
36 |
+
# specify ctc blank char index, since conventially it is the last entry of the logit matrix
|
37 |
+
decoder = build_ctcdecoder(vocab_list, ngram_lm_path, unigrams=unigrams)
|
38 |
+
return decoder
|
39 |
+
|
40 |
+
ngram_lm_model = get_decoder_ngram_model(model.tokenizer, lm_file, vocab_file)
|
41 |
+
|
42 |
+
def transcribe_file(path, max_seconds=20):
|
43 |
+
waveform = model.load_audio(path)
|
44 |
+
if max_seconds > 0:
|
45 |
+
waveform = waveform[:max_seconds*16000]
|
46 |
+
batch = waveform.unsqueeze(0)
|
47 |
+
rel_length = torch.tensor([1.0])
|
48 |
+
with torch.no_grad():
|
49 |
+
logits = model(batch, rel_length)
|
50 |
+
text_batch = [ngram_lm_model.decode(logit.detach().cpu().numpy(), beam_width=500) for logit in logits]
|
51 |
+
return text_batch[0]
|
52 |
+
|
53 |
+
def speech_recognize(file_upload, file_mic):
|
54 |
+
if file_upload is not None:
|
55 |
+
file = file_upload
|
56 |
+
elif file_mic is not None:
|
57 |
+
file = file_mic
|
58 |
+
else:
|
59 |
+
return ""
|
60 |
+
# text = model.transcribe_file(file)
|
61 |
+
text = transcribe_file(file)
|
62 |
+
return text
|
63 |
+
|
64 |
+
inputs = [gr.inputs.Audio(source="upload", type='filepath', optional=True), gr.inputs.Audio(source="microphone", type='filepath', optional=True)]
|
65 |
+
outputs = gr.outputs.Textbox(label="Output Text")
|
66 |
+
title = "wav2vec2-base-vietnamese-270h"
|
67 |
+
description = "Gradio demo for a wav2vec2 base vietnamese speech recognition. To use it, simply upload your audio, click one of the examples to load them, or record from your own microphone. Read more at the links below. Currently supports 16_000hz audio files"
|
68 |
+
article = "<p style='text-align: center'><a href='https://huggingface.co/dragonSwing/wav2vec2-base-vn-270h' target='_blank'>Pretrained model</a></p>"
|
69 |
+
examples=[['example1.wav', 'example1.wav'], ['example2.mp3', 'example2.mp3'], ['example3.mp3', 'example3.mp3'], ['example4.wav', 'example4.wav']]
|
70 |
+
gr.Interface(speech_recognize, inputs, outputs, title=title, description=description, article=article, examples=examples).launch()
|
example1.wav
ADDED
Binary file (120 kB). View file
|
|
example2.mp3
ADDED
Binary file (411 kB). View file
|
|
example3.mp3
ADDED
Binary file (218 kB). View file
|
|
example4.wav
ADDED
Binary file (76.8 kB). View file
|
|
packages.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
libsndfile1
|
requirements.txt
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
torch==1.9.0
|
2 |
+
torchaudio==0.9.1
|
3 |
+
transformers==4.12.5
|
4 |
+
datasets==1.16.4
|
5 |
+
pyctcdecode==0.1.1
|
6 |
+
https://github.com/kpu/kenlm/archive/master.zip
|
7 |
+
git+git://github.com/speechbrain/speechbrain.git@develop
|