Compare commits

...

2 Commits

30 changed files with 235773 additions and 912 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/build
/dist
/__pycache__

3
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

12
.idea/fluesterpost.iml Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PyDocumentationSettings">
<option name="format" value="PLAIN" />
<option name="myDocStringFormat" value="Plain" />
</component>
</module>

View File

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

7
.idea/misc.xml Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Black">
<option name="sdkName" value="Poetry (fluesterpost)" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Poetry (fluesterpost)" project-jdk-type="Python SDK" />
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/fluesterpost.iml" filepath="$PROJECT_DIR$/.idea/fluesterpost.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

43744
build/main/Analysis-00.toc Normal file

File diff suppressed because it is too large Load Diff

33946
build/main/EXE-00.toc Normal file

File diff suppressed because it is too large Load Diff

33941
build/main/PKG-00.toc Normal file

File diff suppressed because it is too large Load Diff

BIN
build/main/PYZ-00.pyz Normal file

Binary file not shown.

9818
build/main/PYZ-00.toc Normal file

File diff suppressed because it is too large Load Diff

BIN
build/main/base_library.zip Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
build/main/main.pkg Normal file

Binary file not shown.

367
build/main/warn-main.txt Normal file
View File

@ -0,0 +1,367 @@
This file lists modules PyInstaller was not able to find. This does not
necessarily mean this module is required for running your program. Python and
Python 3rd-party packages include a lot of conditional or optional modules. For
example the module 'ntpath' only exists on Windows, whereas the module
'posixpath' only exists on Posix systems.
Types if import:
* top-level: imported at the top-level - look at these first
* conditional: imported within an if-statement
* delayed: imported within a function
* optional: imported within a try-except-statement
IMPORTANT: Do NOT post this list to the issue-tracker. Use it as a basis for
tracking down the missing module yourself. Thanks!
missing module named org - imported by pickle (optional)
missing module named _frozen_importlib_external - imported by importlib._bootstrap (delayed), importlib (optional), importlib.abc (optional), zipimport (top-level)
excluded module named _frozen_importlib - imported by importlib (optional), importlib.abc (optional), zipimport (top-level)
missing module named winreg - imported by importlib._bootstrap_external (conditional), mimetypes (optional), urllib.request (delayed, conditional, optional), requests.utils (delayed, conditional, optional), platform (delayed, optional), pygame.sysfont (conditional), torch._appdirs (delayed), distutils._msvccompiler (top-level), pkg_resources._vendor.platformdirs.windows (delayed, optional), pygments.formatters.img (optional), setuptools.msvc (conditional), setuptools._distutils._msvccompiler (top-level), setuptools._distutils.msvc9compiler (top-level), setuptools._distutils.msvccompiler (optional), distutils.msvc9compiler (top-level)
missing module named nt - imported by os (delayed, conditional, optional), ntpath (optional), shutil (conditional), importlib._bootstrap_external (conditional), ctypes (delayed, conditional)
missing module named 'org.python' - imported by copy (optional), xml.sax (delayed, conditional)
missing module named _winapi - imported by encodings (delayed, conditional, optional), ntpath (optional), subprocess (conditional), mimetypes (optional), multiprocessing.connection (optional), multiprocessing.spawn (delayed, conditional), multiprocessing.reduction (conditional), multiprocessing.shared_memory (conditional), multiprocessing.heap (conditional), multiprocessing.popen_spawn_win32 (top-level), asyncio.windows_events (top-level), asyncio.windows_utils (top-level)
missing module named msvcrt - imported by subprocess (optional), getpass (optional), multiprocessing.spawn (delayed, conditional), multiprocessing.popen_spawn_win32 (top-level), asyncio.windows_events (top-level), asyncio.windows_utils (top-level), colorama.winterm (optional), filelock._windows (conditional)
missing module named vms_lib - imported by platform (delayed, optional)
missing module named 'java.lang' - imported by platform (delayed, optional), xml.sax._exceptions (conditional)
missing module named java - imported by platform (delayed)
missing module named _winreg - imported by platform (delayed, optional), pygments.formatters.img (optional)
missing module named win32con - imported by setuptools._distutils.msvccompiler (optional)
missing module named win32api - imported by torch._appdirs (delayed, conditional, optional), setuptools._distutils.msvccompiler (optional)
missing module named _scproxy - imported by urllib.request (conditional)
missing module named 'distutils._log' - imported by setuptools._distutils.command.bdist_dumb (top-level), setuptools._distutils.command.bdist_rpm (top-level), setuptools._distutils.command.build_clib (top-level), setuptools._distutils.command.build_ext (top-level), setuptools._distutils.command.build_py (top-level), setuptools._distutils.command.build_scripts (top-level), setuptools._distutils.command.clean (top-level), setuptools._distutils.command.config (top-level), setuptools._distutils.command.install (top-level), setuptools._distutils.command.install_scripts (top-level), setuptools._distutils.command.register (top-level), setuptools._distutils.command.sdist (top-level)
missing module named usercustomize - imported by site (delayed, optional)
missing module named sitecustomize - imported by site (delayed, optional)
missing module named 'docutils.nodes' - imported by setuptools._distutils.command.check (top-level)
missing module named 'docutils.frontend' - imported by setuptools._distutils.command.check (top-level)
missing module named 'docutils.parsers' - imported by setuptools._distutils.command.check (top-level)
missing module named docutils - imported by setuptools._distutils.command.check (top-level)
missing module named multiprocessing.set_start_method - imported by multiprocessing (top-level), multiprocessing.spawn (top-level)
missing module named multiprocessing.get_start_method - imported by multiprocessing (top-level), multiprocessing.spawn (top-level)
missing module named multiprocessing.get_context - imported by multiprocessing (top-level), multiprocessing.pool (top-level), multiprocessing.managers (top-level), multiprocessing.sharedctypes (top-level)
missing module named multiprocessing.TimeoutError - imported by multiprocessing (top-level), multiprocessing.pool (top-level)
missing module named multiprocessing.BufferTooShort - imported by multiprocessing (top-level), multiprocessing.connection (top-level)
missing module named multiprocessing.AuthenticationError - imported by multiprocessing (top-level), multiprocessing.connection (top-level)
missing module named multiprocessing.RLock - imported by multiprocessing (delayed, conditional, optional), tqdm.std (delayed, conditional, optional)
missing module named _overlapped - imported by asyncio.windows_events (top-level)
missing module named asyncio.DefaultEventLoopPolicy - imported by asyncio (delayed, conditional), asyncio.events (delayed, conditional)
missing module named _manylinux - imported by packaging._manylinux (delayed, optional), setuptools._vendor.packaging._manylinux (delayed, optional), pkg_resources._vendor.packaging._manylinux (delayed, optional)
missing module named 'setuptools.extern.jaraco' - imported by setuptools._reqs (top-level), setuptools._entry_points (top-level), setuptools.command._requirestxt (top-level), setuptools._vendor.jaraco.text (top-level)
missing module named setuptools.extern.importlib_resources - imported by setuptools.extern (conditional), setuptools._importlib (conditional), setuptools._vendor.jaraco.text (optional)
missing module named setuptools.extern.tomli - imported by setuptools.extern (delayed), setuptools.config.pyprojecttoml (delayed)
missing module named setuptools.extern.importlib_metadata - imported by setuptools.extern (conditional), setuptools._importlib (conditional)
missing module named setuptools.extern.packaging - imported by setuptools.extern (top-level), setuptools._normalization (top-level), setuptools.command.egg_info (top-level)
missing module named 'setuptools.extern.more_itertools' - imported by setuptools.dist (top-level), setuptools._itertools (top-level), setuptools._entry_points (top-level), setuptools.config.expand (delayed), setuptools.config.pyprojecttoml (delayed), setuptools.msvc (top-level), setuptools._vendor.jaraco.functools (top-level)
missing module named jnius - imported by pkg_resources._vendor.platformdirs.android (delayed, optional)
missing module named platformdirs - imported by pkg_resources._vendor.platformdirs.__main__ (top-level)
missing module named 'pkg_resources.extern.importlib_resources' - imported by pkg_resources._vendor.jaraco.text (optional)
missing module named 'pkg_resources.extern.more_itertools' - imported by pkg_resources._vendor.jaraco.functools (top-level)
missing module named pkg_resources.extern.packaging - imported by pkg_resources.extern (top-level), pkg_resources (top-level)
missing module named pkg_resources.extern.platformdirs - imported by pkg_resources.extern (top-level), pkg_resources (top-level)
missing module named 'pkg_resources.extern.jaraco' - imported by pkg_resources (top-level), pkg_resources._vendor.jaraco.text (top-level)
missing module named 'setuptools.extern.packaging.requirements' - imported by setuptools._reqs (top-level), setuptools._core_metadata (top-level), setuptools.config.setupcfg (top-level), setuptools.command._requirestxt (top-level)
missing module named 'setuptools.extern.packaging.utils' - imported by setuptools.wheel (top-level)
missing module named 'setuptools.extern.packaging.tags' - imported by setuptools.wheel (top-level)
missing module named trove_classifiers - imported by setuptools.config._validate_pyproject.formats (optional)
missing module named importlib_metadata - imported by pygments.plugin (delayed, optional), setuptools._importlib (delayed, optional), pydantic.version (delayed, conditional), pydantic.plugin._loader (conditional)
missing module named 'setuptools.extern.packaging.version' - imported by setuptools._core_metadata (top-level), setuptools.depends (top-level), setuptools.dist (top-level), setuptools.config.setupcfg (top-level), setuptools.wheel (top-level)
missing module named 'setuptools.extern.packaging.specifiers' - imported by setuptools.dist (top-level), setuptools.config.setupcfg (top-level), setuptools.config._apply_pyprojecttoml (delayed)
missing module named 'setuptools.extern.packaging.markers' - imported by setuptools._core_metadata (top-level), setuptools.dist (top-level), setuptools.config.setupcfg (top-level)
missing module named 'setuptools.extern.ordered_set' - imported by setuptools.dist (top-level)
missing module named pyimod02_importers - imported by /home/yannik/.cache/pypoetry/virtualenvs/fluesterpost-4jW3LC84-py3.11/lib/python3.11/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgutil.py (delayed), /home/yannik/.cache/pypoetry/virtualenvs/fluesterpost-4jW3LC84-py3.11/lib/python3.11/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgres.py (delayed)
missing module named simplejson - imported by requests.compat (conditional, optional), huggingface_hub.utils._fixes (optional)
missing module named dummy_threading - imported by requests.cookies (optional)
missing module named zstandard - imported by urllib3.response (optional), urllib3.util.request (optional), fsspec.compression (optional)
missing module named brotli - imported by urllib3.response (optional), urllib3.util.request (optional), httpx._compat (optional)
missing module named brotlicffi - imported by urllib3.response (optional), urllib3.util.request (optional), httpx._compat (optional)
missing module named socks - imported by urllib3.contrib.socks (optional)
missing module named cryptography - imported by urllib3.contrib.pyopenssl (top-level), requests (conditional, optional)
missing module named 'OpenSSL.crypto' - imported by urllib3.contrib.pyopenssl (delayed, conditional)
missing module named 'cryptography.x509' - imported by urllib3.contrib.pyopenssl (delayed, optional)
missing module named OpenSSL - imported by urllib3.contrib.pyopenssl (top-level)
missing module named chardet - imported by requests.compat (optional), requests (optional), requests.packages (optional), pygments.lexer (delayed, conditional, optional)
missing module named urllib3_secure_extra - imported by urllib3 (optional)
missing module named 'IPython.display' - imported by tqdm.notebook (conditional, optional), huggingface_hub._login (delayed, optional)
missing module named 'IPython.html' - imported by tqdm.notebook (conditional, optional)
missing module named ipywidgets - imported by tqdm.notebook (conditional, optional)
missing module named setuptools_scm - imported by tqdm.version (optional)
missing module named 'matplotlib.pyplot' - imported by tqdm.gui (delayed), networkx.drawing.nx_pylab (delayed), triton.testing (delayed)
missing module named matplotlib - imported by sympy.testing.runtests (delayed, conditional), tqdm.gui (delayed), networkx.drawing.nx_pylab (delayed)
missing module named 'pandas.core' - imported by tqdm.std (delayed, optional)
missing module named pandas - imported by tqdm.std (delayed, optional), networkx.convert (delayed, optional), networkx.convert_matrix (delayed), networkx.algorithms.centrality.group (delayed), triton.testing (delayed), torch.utils.data.datapipes.dataframe.dataframe_wrapper (delayed, optional)
missing module named hf_transfer - imported by huggingface_hub.lfs (delayed, optional), huggingface_hub.file_download (delayed, conditional, optional)
missing module named _version_meson - imported by numpy.version (optional)
missing module named _dummy_thread - imported by numpy.core.arrayprint (optional), torch._jit_internal (optional)
missing module named psutil - imported by numpy.testing._private.utils (delayed, optional), triton.testing (delayed)
missing module named numpy.core.result_type - imported by numpy.core (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.core.float_ - imported by numpy.core (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.core.number - imported by numpy.core (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.core.object_ - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.testing._private.utils (delayed)
missing module named numpy.core.max - imported by numpy.core (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.core.all - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.testing._private.utils (delayed)
missing module named numpy.core.errstate - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.testing._private.utils (delayed)
missing module named numpy.core.bool_ - imported by numpy.core (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.core.inf - imported by numpy.core (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.core.isnan - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.testing._private.utils (delayed)
missing module named numpy.core.array2string - imported by numpy.core (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.lib.imag - imported by numpy.lib (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.lib.real - imported by numpy.lib (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.lib.iscomplexobj - imported by numpy.lib (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.core.signbit - imported by numpy.core (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.core.isscalar - imported by numpy.core (delayed), numpy.testing._private.utils (delayed), numpy.lib.polynomial (top-level)
missing module named win32pdh - imported by numpy.testing._private.utils (delayed, conditional)
missing module named numpy.core.array - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.testing._private.utils (top-level), numpy.lib.polynomial (top-level)
missing module named numpy.core.isnat - imported by numpy.core (top-level), numpy.testing._private.utils (top-level)
missing module named numpy.core.ndarray - imported by numpy.core (top-level), numpy.testing._private.utils (top-level), numpy.lib.utils (top-level)
missing module named numpy.core.array_repr - imported by numpy.core (top-level), numpy.testing._private.utils (top-level)
missing module named numpy.core.arange - imported by numpy.core (top-level), numpy.testing._private.utils (top-level), numpy.fft.helper (top-level)
missing module named numpy.core.empty - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.testing._private.utils (top-level), numpy.fft.helper (top-level)
missing module named numpy.core.float32 - imported by numpy.core (top-level), numpy.testing._private.utils (top-level)
missing module named numpy.core.intp - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.testing._private.utils (top-level)
missing module named numpy.core.linspace - imported by numpy.core (top-level), numpy.lib.index_tricks (top-level)
missing module named numpy.core.iinfo - imported by numpy.core (top-level), numpy.lib.twodim_base (top-level)
missing module named numpy.core.transpose - imported by numpy.core (top-level), numpy.lib.function_base (top-level)
missing module named numpy.core.asarray - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.lib.utils (top-level), numpy.fft._pocketfft (top-level), numpy.fft.helper (top-level)
missing module named numpy.core.integer - imported by numpy.core (top-level), numpy.fft.helper (top-level)
missing module named numpy.core.sqrt - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.fft._pocketfft (top-level)
missing module named numpy.core.conjugate - imported by numpy.core (top-level), numpy.fft._pocketfft (top-level)
missing module named numpy.core.swapaxes - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.fft._pocketfft (top-level)
missing module named numpy.core.zeros - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.fft._pocketfft (top-level)
missing module named _ufunc - imported by numpy._typing (conditional)
missing module named numpy.core.reciprocal - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.sort - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.argsort - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.sign - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.count_nonzero - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.divide - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.matmul - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.asanyarray - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.atleast_2d - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.prod - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.amax - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.amin - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.moveaxis - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.geterrobj - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.finfo - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.lib.polynomial (top-level)
missing module named numpy.core.isfinite - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.sum - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.multiply - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.add - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.dot - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.lib.polynomial (top-level)
missing module named numpy.core.Inf - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.newaxis - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.complexfloating - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.inexact - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.cdouble - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.csingle - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.double - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.single - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.intc - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.empty_like - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named threadpoolctl - imported by numpy.lib.utils (delayed, optional)
missing module named numpy.core.ufunc - imported by numpy.core (top-level), numpy.lib.utils (top-level)
missing module named numpy.core.ones - imported by numpy.core (top-level), numpy.lib.polynomial (top-level)
missing module named numpy.core.hstack - imported by numpy.core (top-level), numpy.lib.polynomial (top-level)
missing module named numpy.core.atleast_1d - imported by numpy.core (top-level), numpy.lib.polynomial (top-level)
missing module named numpy.core.atleast_3d - imported by numpy.core (top-level), numpy.lib.shape_base (top-level)
missing module named numpy.core.vstack - imported by numpy.core (top-level), numpy.lib.shape_base (top-level)
missing module named pickle5 - imported by numpy.compat.py3k (optional)
missing module named numpy.eye - imported by numpy (delayed), numpy.core.numeric (delayed)
missing module named numpy.recarray - imported by numpy (top-level), numpy.lib.recfunctions (top-level), numpy.ma.mrecords (top-level)
missing module named numpy.expand_dims - imported by numpy (top-level), numpy.ma.core (top-level)
missing module named numpy.array - imported by numpy (top-level), numpy.ma.core (top-level), numpy.ma.extras (top-level), numpy.ma.mrecords (top-level), pygame.surfarray (top-level)
missing module named numpy.iscomplexobj - imported by numpy (top-level), numpy.ma.core (top-level)
missing module named numpy.amin - imported by numpy (top-level), numpy.ma.core (top-level)
missing module named numpy.amax - imported by numpy (top-level), numpy.ma.core (top-level)
missing module named numpy.isinf - imported by numpy (top-level), numpy.testing._private.utils (top-level)
missing module named numpy.isnan - imported by numpy (top-level), numpy.testing._private.utils (top-level)
missing module named numpy.isfinite - imported by numpy (top-level), numpy.testing._private.utils (top-level)
missing module named numpy.float64 - imported by numpy (top-level), numpy.array_api._typing (top-level)
missing module named numpy.float32 - imported by numpy (top-level), numpy.array_api._typing (top-level)
missing module named numpy.uint64 - imported by numpy (top-level), numpy.array_api._typing (top-level)
missing module named numpy.uint32 - imported by numpy (top-level), numpy.array_api._typing (top-level), pygame.surfarray (top-level)
missing module named numpy.uint16 - imported by numpy (top-level), numpy.array_api._typing (top-level)
missing module named numpy.uint8 - imported by numpy (top-level), numpy.array_api._typing (top-level)
missing module named numpy.int64 - imported by numpy (top-level), numpy.array_api._typing (top-level)
missing module named numpy.int32 - imported by numpy (top-level), numpy.array_api._typing (top-level)
missing module named numpy.int16 - imported by numpy (top-level), numpy.array_api._typing (top-level)
missing module named numpy.int8 - imported by numpy (top-level), numpy.array_api._typing (top-level)
missing module named numpy.bytes_ - imported by numpy (top-level), numpy._typing._array_like (top-level)
missing module named numpy.str_ - imported by numpy (top-level), numpy._typing._array_like (top-level)
missing module named numpy.void - imported by numpy (top-level), numpy._typing._array_like (top-level)
missing module named numpy.object_ - imported by numpy (top-level), numpy._typing._array_like (top-level)
missing module named numpy.datetime64 - imported by numpy (top-level), numpy._typing._array_like (top-level)
missing module named numpy.timedelta64 - imported by numpy (top-level), numpy._typing._array_like (top-level)
missing module named numpy.number - imported by numpy (top-level), numpy._typing._array_like (top-level)
missing module named numpy.complexfloating - imported by numpy (top-level), numpy._typing._array_like (top-level)
missing module named numpy.floating - imported by numpy (top-level), numpy._typing._array_like (top-level)
missing module named numpy.integer - imported by numpy (top-level), numpy._typing._array_like (top-level), numpy.ctypeslib (top-level)
missing module named numpy.unsignedinteger - imported by numpy (top-level), numpy._typing._array_like (top-level)
missing module named numpy.bool_ - imported by numpy (top-level), numpy._typing._array_like (top-level), numpy.ma.core (top-level), numpy.ma.mrecords (top-level)
missing module named numpy.generic - imported by numpy (top-level), numpy._typing._array_like (top-level)
missing module named numpy.dtype - imported by numpy (top-level), numpy._typing._array_like (top-level), numpy.array_api._typing (top-level), numpy.ma.mrecords (top-level), numpy.ctypeslib (top-level)
missing module named numpy.ndarray - imported by numpy (top-level), numpy._typing._array_like (top-level), numpy.ma.core (top-level), numpy.ma.extras (top-level), numpy.lib.recfunctions (top-level), numpy.ma.mrecords (top-level), numpy.ctypeslib (top-level), pygame.surfarray (top-level)
missing module named numpy.ufunc - imported by numpy (top-level), numpy._typing (top-level), numpy.testing.overrides (top-level)
missing module named numpy.histogramdd - imported by numpy (delayed), numpy.lib.twodim_base (delayed)
missing module named tensorflow - imported by ctranslate2.converters.openai_gpt2 (delayed), huggingface_hub.keras_mixin (delayed, conditional)
missing module named PIL - imported by sympy.plotting.pygletplot.plot (delayed), networkx.drawing.nx_agraph (delayed, conditional), huggingface_hub.inference._common (delayed, conditional), huggingface_hub.inference._types (conditional), huggingface_hub.inference._client (conditional), huggingface_hub.inference._generated._async_client (conditional), huggingface_hub.inference_api (delayed, conditional), pygments.formatters.img (optional)
missing module named email_validator - imported by pydantic.networks (delayed, conditional, optional)
missing module named pydantic.BaseModel - imported by pydantic (conditional), pydantic.deprecated.copy_internals (delayed, conditional), pydantic._internal._generate_schema (delayed, conditional), huggingface_hub._webhooks_payload (top-level)
missing module named rich - imported by httpx._main (top-level), pydantic._internal._core_utils (delayed)
missing module named pydantic.PydanticSchemaGenerationError - imported by pydantic (delayed, conditional), pydantic.functional_validators (delayed, conditional)
missing module named aiohttp - imported by huggingface_hub.inference._common (delayed, conditional)
missing module named dl - imported by setuptools.command.build_ext (conditional, optional)
missing module named Cython - imported by setuptools.command.build_ext (optional)
missing module named 'win32com.shell' - imported by torch._appdirs (conditional, optional)
missing module named 'com.sun' - imported by torch._appdirs (delayed, conditional, optional)
missing module named com - imported by torch._appdirs (delayed)
missing module named win32com - imported by torch._appdirs (delayed)
missing module named torch.nn.Module - imported by torch.nn (top-level), torch.optim.swa_utils (top-level), torch.jit._recursive (top-level), torch.jit._script (top-level), torch.jit._trace (top-level), torch.distributed.nn.api.remote_module (top-level), torch._dynamo.mutation_guard (top-level), torch.fx.passes.utils.common (top-level), torch.ao.quantization.fake_quantize (top-level)
missing module named pydot - imported by networkx.drawing.nx_pydot (delayed), torch.fx.passes.graph_drawer (optional)
missing module named pygraphviz - imported by networkx.drawing.nx_agraph (delayed, optional)
missing module named 'matplotlib.cm' - imported by networkx.drawing.nx_pylab (delayed)
missing module named 'matplotlib.path' - imported by networkx.drawing.nx_pylab (delayed)
missing module named 'matplotlib.patches' - imported by networkx.drawing.nx_pylab (delayed)
missing module named 'matplotlib.colors' - imported by networkx.drawing.nx_pylab (delayed)
missing module named 'matplotlib.collections' - imported by networkx.drawing.nx_pylab (delayed)
missing module named scipy - imported by sympy.functions.special.bessel (delayed, conditional), networkx.convert (delayed, optional), networkx.convert_matrix (delayed), networkx.generators.geometric (delayed, optional), networkx.algorithms.assortativity.correlation (delayed), networkx.algorithms.centrality.flow_matrix (delayed), networkx.algorithms.centrality.eigenvector (delayed), networkx.algorithms.centrality.subgraph_alg (delayed), networkx.algorithms.centrality.laplacian (delayed), networkx.algorithms.communicability_alg (delayed), networkx.algorithms.distance_measures (delayed), networkx.algorithms.link_analysis.hits_alg (delayed), networkx.algorithms.link_analysis.pagerank_alg (delayed), networkx.algorithms.similarity (delayed), networkx.algorithms.approximation.traveling_salesman (delayed), networkx.algorithms.bipartite.matrix (delayed), networkx.algorithms.bipartite.matching (delayed), networkx.algorithms.bipartite.spectral (delayed), networkx.algorithms.node_classification (delayed), networkx.generators.random_graphs (delayed, conditional), networkx.generators.spectral_graph_forge (delayed), networkx.linalg.attrmatrix (delayed), networkx.linalg.spectrum (delayed), networkx.linalg.graphmatrix (delayed), networkx.linalg.laplacianmatrix (delayed), networkx.linalg.algebraicconnectivity (delayed, conditional), networkx.linalg.bethehessianmatrix (delayed), networkx.drawing.layout (delayed)
missing module named 'sage.interfaces' - imported by sympy.core.basic (delayed)
missing module named gmpy2 - imported by mpmath.libmp.backend (conditional, optional), sympy.polys.domains.groundtypes (conditional), sympy.ntheory.primetest (delayed, conditional), sympy.testing.runtests (delayed, conditional)
missing module named 'sage.libs' - imported by mpmath.libmp.backend (conditional, optional), mpmath.libmp.libelefun (conditional, optional), mpmath.libmp.libmpf (conditional, optional), mpmath.libmp.libmpc (conditional, optional), mpmath.libmp.libhyper (delayed, conditional), mpmath.ctx_mp (conditional)
missing module named sage - imported by mpmath.libmp.backend (conditional, optional)
missing module named gmpy - imported by mpmath.libmp.backend (conditional, optional), sympy.testing.runtests (delayed, conditional)
missing module named 'scipy.special' - imported by sympy.functions.special.bessel (delayed, conditional, optional), networkx.generators.community (delayed, optional)
missing module named pysat - imported by sympy.logic.algorithms.minisat22_wrapper (delayed)
missing module named pycosat - imported by sympy.logic.algorithms.pycosat_wrapper (delayed)
missing module named 'sage.all' - imported by sympy.core.function (delayed)
missing module named mpl_toolkits - imported by mpmath.visualization (delayed)
missing module named pylab - imported by mpmath.visualization (delayed, conditional)
missing module named pyglet - imported by sympy.plotting.pygletplot.plot (optional), sympy.plotting.pygletplot.plot_axes (top-level), sympy.printing.preview (delayed, conditional, optional), sympy.testing.runtests (delayed, conditional)
missing module named all - imported by sympy.testing.runtests (delayed, optional)
missing module named 'IPython.Shell' - imported by sympy.interactive.session (delayed, conditional)
missing module named 'IPython.frontend' - imported by sympy.interactive.printing (delayed, conditional, optional), sympy.interactive.session (delayed, conditional)
missing module named 'IPython.terminal' - imported by sympy.interactive.printing (delayed, conditional, optional), sympy.interactive.session (delayed, conditional)
missing module named IPython - imported by sympy.interactive.printing (delayed, conditional, optional), sympy.interactive.session (delayed, conditional, optional)
missing module named 'IPython.iplib' - imported by sympy.interactive.printing (delayed, optional)
missing module named 'IPython.core' - imported by sympy.interactive.printing (delayed, optional)
missing module named 'pyglet.gl' - imported by sympy.plotting.pygletplot.plot_axes (top-level), sympy.plotting.pygletplot.util (top-level), sympy.plotting.pygletplot.plot_window (top-level), sympy.plotting.pygletplot.plot_camera (top-level), sympy.plotting.pygletplot.plot_rotation (top-level), sympy.plotting.pygletplot.plot_curve (top-level), sympy.plotting.pygletplot.plot_mode_base (top-level), sympy.plotting.pygletplot.plot_surface (top-level)
missing module named 'pyglet.window' - imported by sympy.plotting.pygletplot.managed_window (top-level), sympy.plotting.pygletplot.plot_controller (top-level), sympy.printing.preview (delayed, optional)
missing module named 'pyglet.clock' - imported by sympy.plotting.pygletplot.managed_window (top-level)
missing module named 'pyglet.image' - imported by sympy.printing.preview (delayed, optional)
missing module named lxml - imported by sympy.utilities.mathml (delayed)
missing module named py - imported by mpmath.tests.runtests (delayed, conditional)
missing module named 'lxml.etree' - imported by networkx.readwrite.graphml (delayed, optional)
missing module named pytest - imported by networkx.utils.backends (delayed, conditional, optional)
missing module named foo - imported by torch._functorch.compilers (delayed)
missing module named 'torch._C._profiler' - imported by torch.profiler (top-level), torch.autograd.profiler (top-level), torch.profiler.profiler (top-level), torch.profiler._memory_profiler (top-level), torch.cuda._memory_viz (delayed), torch.autograd (top-level)
missing module named torch.distributed.ReduceOp - imported by torch.distributed (top-level), torch.distributed.nn.functional (top-level)
missing module named torch.distributed.group - imported by torch.distributed (top-level), torch.distributed.nn.functional (top-level), torch.distributed.algorithms.model_averaging.utils (top-level)
missing module named 'torch._C._distributed_c10d' - imported by torch.distributed (conditional), torch.distributed.distributed_c10d (top-level), torch.distributed.rpc (conditional), torch.distributed._shard.sharded_tensor.reshard (top-level), torch.distributed._shard.sharding_spec.chunk_sharding_spec_ops.embedding_bag (top-level), torch.distributed.constants (top-level)
missing module named torchvision - imported by torch._inductor.utils (delayed, optional)
missing module named 'triton._C.libtriton.triton' - imported by triton.impl (top-level), triton.compiler (top-level), triton.testing (top-level), triton.language.semantic (top-level), triton.language.core (top-level), triton.ops.matmul_perf_model (top-level), torch._inductor.triton_ops.conv_perf_model (delayed)
missing module named 'triton._C.libtriton.cutlass' - imported by triton.testing (optional)
missing module named 'torch._C._dynamo' - imported by torch._dynamo.eval_frame (conditional), torch._dynamo.types (conditional)
missing module named 'torch._C._distributed_autograd' - imported by torch.distributed.autograd (conditional)
missing module named 'torch._C._distributed_rpc' - imported by torch.distributed.rpc (conditional), torch.distributed.rpc.api (top-level), torch.distributed.rpc.internal (top-level), torch.distributed.rpc.constants (top-level), torch.distributed.rpc.options (top-level), torch._jit_internal (conditional)
missing module named torchdistx - imported by torch.distributed.fsdp._init_utils (optional)
missing module named transformers - imported by torch._dynamo.variables.dicts (delayed), torch._dynamo.variables.torch (optional), ctranslate2.converters.transformers (optional)
missing module named 'transformers.configuration_utils' - imported by torch._dynamo.variables.dicts (delayed, optional)
missing module named 'transformers.file_utils' - imported by torch._dynamo.variables.dicts (delayed, optional)
missing module named 'torch._prims.wrappers' - imported by torch._dynamo.skipfiles (optional)
missing module named 'torch._prims.utils' - imported by torch._dynamo.skipfiles (optional)
missing module named dill - imported by torch._dynamo.replay_record (optional), torch.utils.data._utils.serialization (optional), torch.utils.data.graph (delayed, conditional, optional), torch.utils.data.datapipes.datapipe (optional)
missing module named tabulate - imported by torch._dynamo.utils (delayed, optional), torch._dynamo.backends.distributed (delayed, optional), torch.fx.graph (delayed, optional)
missing module named win32evtlog - imported by logging.handlers (delayed, optional)
missing module named win32evtlogutil - imported by logging.handlers (delayed, optional)
missing module named 'torch._C._jit_tree_views' - imported by torch._sources (top-level), torch.jit.frontend (top-level)
missing module named 'torch._C._functorch' - imported by torch._functorch.pyfunctorch (top-level), torch._functorch.vmap (top-level), torch._functorch.utils (top-level), torch._functorch.eager_transforms (top-level), torch._functorch.autograd_function (top-level)
missing module named astunparse - imported by torch.jit.frontend (optional)
missing module named 'monkeytype.tracing' - imported by torch.jit._monkeytype_config (optional)
missing module named 'monkeytype.config' - imported by torch.jit._monkeytype_config (optional)
missing module named 'monkeytype.db' - imported by torch.jit._monkeytype_config (optional)
missing module named monkeytype - imported by torch.jit._monkeytype_config (optional)
missing module named 'torch._C._autograd' - imported by torch.profiler (top-level), torch.profiler._memory_profiler (top-level), torch.autograd (top-level)
missing module named 'scipy.io' - imported by torch.utils.data.datapipes.utils.decoder (delayed, optional)
missing module named torchaudio - imported by torch.utils.data.datapipes.utils.decoder (delayed, optional)
missing module named 'torchvision.io' - imported by torch.utils.data.datapipes.utils.decoder (delayed, optional)
missing module named 'PIL.Image' - imported by torch.utils.data.datapipes.utils.decoder (delayed, optional)
missing module named torcharrow - imported by torch.utils.data.datapipes.iter.callable (delayed, conditional, optional)
missing module named torch.Generator - imported by torch (top-level), torch.utils.data.dataset (top-level)
missing module named torch.randperm - imported by torch (top-level), torch.utils.data.dataset (top-level)
missing module named torch.default_generator - imported by torch (top-level), torch.utils.data.dataset (top-level)
missing module named beartype - imported by torch.onnx._internal._beartype (optional)
missing module named onnx - imported by torch.onnx._internal.onnx_proto_utils (delayed, optional)
missing module named 'torch._C._onnx' - imported by torch.onnx (top-level), torch.onnx._globals (top-level), torch.onnx.symbolic_helper (top-level), torch.onnx.symbolic_opset9 (top-level), torch.onnx.symbolic_opset10 (top-level), torch.onnx.utils (top-level), torch.onnx.symbolic_opset13 (top-level)
missing module named torch.multiprocessing._prctl_pr_set_pdeathsig - imported by torch.multiprocessing (top-level), torch.multiprocessing.spawn (top-level)
missing module named pynvml - imported by torch.cuda (delayed, optional), torch.cuda.memory (delayed, optional)
missing module named opt_einsum - imported by torch.backends.opt_einsum (optional)
missing module named 'torch._C._VariableFunctions' - imported by torch (conditional)
missing module named torch.Size - imported by torch (top-level), torch.nn.modules.normalization (top-level)
missing module named torch.norm_except_dim - imported by torch (top-level), torch.nn.utils.weight_norm (top-level)
missing module named torch._weight_norm - imported by torch (top-level), torch.nn.utils.weight_norm (top-level)
missing module named torch.device - imported by torch (top-level), torch.nn.modules.module (top-level), torch.cuda (top-level), torch.distributed.nn.api.remote_module (top-level)
missing module named distributed - imported by fsspec.transaction (delayed)
missing module named lz4 - imported by fsspec.compression (optional)
missing module named snappy - imported by fsspec.compression (delayed, optional)
missing module named lzmaffi - imported by fsspec.compression (optional)
missing module named isal - imported by fsspec.compression (optional)
missing module named fastai - imported by huggingface_hub.fastai_utils (delayed)
missing module named toml - imported by huggingface_hub.fastai_utils (delayed, optional)
missing module named 'fastapi.responses' - imported by huggingface_hub._webhooks_server (top-level)
missing module named fastapi - imported by huggingface_hub._webhooks_server (top-level)
missing module named gradio - imported by huggingface_hub._webhooks_server (delayed, conditional)
missing module named tensorboardX - imported by huggingface_hub._tensorboard_logger (conditional)
missing module named 'ipywidgets.widgets' - imported by huggingface_hub._login (delayed, optional)
missing module named 'InquirerPy.separator' - imported by huggingface_hub.commands.delete_cache (optional)
missing module named 'InquirerPy.base' - imported by huggingface_hub.commands.delete_cache (optional)
missing module named InquirerPy - imported by huggingface_hub.commands.delete_cache (optional)
missing module named build_and_package_info - imported by onnxruntime.capi.onnxruntime_validation (delayed, conditional, optional)
missing module named 'onnxruntime.training' - imported by onnxruntime.capi.onnxruntime_validation (delayed, optional)
missing module named onnxruntime.capi.version_info - imported by onnxruntime.capi (conditional), onnxruntime.capi._pybind_state (conditional)
missing module named sentencepiece_model_pb2 - imported by tokenizers.implementations.sentencepiece_unigram (delayed, optional)
missing module named 'opennmt.utils' - imported by ctranslate2.converters.opennmt_tf (delayed)
missing module named opennmt - imported by ctranslate2.converters.opennmt_tf (delayed)
missing module named 'fairseq.utils' - imported by ctranslate2.converters.fairseq (delayed, conditional)
missing module named fairseq - imported by ctranslate2.converters.fairseq (delayed)
missing module named OpenGL - imported by pygame (delayed)
missing module named pygame.register_quit - imported by pygame (top-level), pygame.fastevent (top-level)
missing module named pygame.error - imported by pygame (top-level), pygame.fastevent (top-level)
missing module named 'pygame.overlay' - imported by pygame (optional)
missing module named 'pygame.cdrom' - imported by pygame (conditional, optional)
missing module named wsaccel - imported by websocket._utils (optional)
missing module named 'python_socks._types' - imported by websocket._http (optional)
missing module named 'python_socks._errors' - imported by websocket._http (optional)
missing module named python_socks - imported by websocket._http (optional)
missing module named 'wsaccel.xormask' - imported by websocket._abnf (optional)
missing module named jwt - imported by oauthlib.common (delayed), oauthlib.oauth2.rfc6749.clients.service_application (delayed)
missing module named blinker - imported by oauthlib.signals (optional)
missing module named 'rich.table' - imported by httpx._main (top-level)
missing module named 'rich.syntax' - imported by httpx._main (top-level)
missing module named 'rich.progress' - imported by httpx._main (top-level)
missing module named 'rich.markup' - imported by httpx._main (top-level)
missing module named pygments.lexers.PrologLexer - imported by pygments.lexers (top-level), pygments.lexers.cplint (top-level)
missing module named ctags - imported by pygments.formatters.html (optional)
missing module named trio - imported by httpx._utils (delayed, conditional), httpx._transports.asgi (delayed, conditional), httpcore._synchronization (optional), httpcore._backends.trio (top-level)
missing module named 'trio.testing' - imported by anyio._backends._trio (delayed)
missing module named exceptiongroup - imported by anyio._core._sockets (conditional), anyio._backends._asyncio (conditional), anyio._backends._trio (conditional)
missing module named 'trio.to_thread' - imported by anyio._backends._trio (top-level)
missing module named 'trio.socket' - imported by anyio._backends._trio (top-level)
missing module named outcome - imported by anyio._backends._trio (top-level)
missing module named 'trio.lowlevel' - imported by anyio._backends._trio (top-level)
missing module named 'trio.from_thread' - imported by anyio._backends._trio (top-level)
missing module named uvloop - imported by anyio._backends._asyncio (delayed, conditional)
missing module named curio - imported by sniffio._impl (delayed, conditional), httpx._utils (delayed, conditional)
missing module named _typeshed - imported by anyio._core._fileio (conditional), httpx._transports.wsgi (conditional)
missing module named socksio - imported by httpcore._sync.socks_proxy (top-level), httpcore._async.socks_proxy (top-level), httpx._transports.default (delayed, conditional, optional)
missing module named 'h2.settings' - imported by httpcore._sync.http2 (top-level), httpcore._async.http2 (top-level)
missing module named 'h2.exceptions' - imported by httpcore._sync.http2 (top-level), httpcore._async.http2 (top-level)
missing module named 'h2.events' - imported by httpcore._sync.http2 (top-level), httpcore._async.http2 (top-level)
missing module named 'h2.connection' - imported by httpcore._sync.http2 (top-level), httpcore._async.http2 (top-level)
missing module named h2 - imported by httpcore._sync.http2 (top-level), httpx._client (delayed, conditional, optional)
missing module named 'h2.config' - imported by httpcore._async.http2 (top-level)
missing module named click - imported by httpx._main (top-level)
missing module named '_typeshed.wsgi' - imported by httpx._transports.wsgi (conditional)
missing module named 'six.moves.urllib'.parse - imported by 'six.moves.urllib' (top-level), repath (top-level)
runtime module named six.moves - imported by 'six.moves.urllib' (top-level)
missing module named 'six.moves.urllib' - imported by 'six.moves.urllib' (top-level)
missing module named StringIO - imported by six (conditional)

112702
build/main/xref-main.html Normal file

File diff suppressed because it is too large Load Diff

534
main.py
View File

@ -1,6 +1,10 @@
import os
import pprint
import traceback
import typing
import requests.exceptions
import validators
import utils
import flet as ft
@ -10,30 +14,154 @@ from typing import DefaultDict
import pygame
import nn_model_manager as mm
import whisper_webservice_interface
import wave
import sys
import pyaudio
# === TEMP ===
import logging
logging.basicConfig()
logging.getLogger("faster_whisper").setLevel(logging.DEBUG)
# === END ===
# globals
transcribe_ready: bool = False
recording: bool = False
rec_stream: pyaudio.Stream | None = None
sound_chunks = []
recorded_audio = []
# AUDIO stuff
REC_CHUNK = 1024
REC_FORMAT = pyaudio.paInt16
REC_CHANNELS = 1
REC_RATE = 16000
REC_RECORD_SECONDS = 5
def main(page):
pygame.mixer.init()
first_name = ft.Ref[ft.TextField]()
last_name = ft.Ref[ft.TextField]()
greetings = ft.Ref[ft.Column]()
# get audio device names
p = pyaudio.PyAudio()
capture_devices = [(i, p.get_device_info_by_index(i)['name']) for i in range(p.get_device_count()) if
p.get_device_info_by_index(i)['maxInputChannels'] > 0]
record_button = ft.Ref[ft.IconButton]()
mic_select = ft.Ref[ft.Dropdown]()
file_tree = ft.Ref[ft.Column]()
file_tree_empty_text = ft.Ref[ft.Text]()
load_model_text = ft.Ref[ft.Text]()
# mode select
current_mode_select = ft.Ref[ft.Dropdown]()
current_mode_info_text = ft.Ref[ft.Text]()
processing_spinner = ft.Ref[ft.ProgressRing]()
# local model mode
model_size_select = ft.Ref[ft.Dropdown]()
model_device_select = ft.Ref[ft.Dropdown]()
# model_bits_select = ft.Ref[ft.Dropdown]()
model_load_unload_button = ft.Ref[ft.IconButton]()
model_loading_spinner = ft.Ref[ft.ProgressRing]()
# docker whisper webservice mode
whisper_webservice_url_input = ft.Ref[ft.TextField]()
transcribe_buttons: list[ft.Ref[ft.IconButton]] = []
output_text_container = ft.Ref[ft.Container]()
output_text_col = ft.Ref[ft.Column]()
def transcribe(fileOrBytes: str | bytes):
print(f"DEBUG: trying to transcribe audio {fileOrBytes if isinstance(fileOrBytes, str) else f'with len {len(fileOrBytes)}'}")
# === LOCAL MODEL CODE ===
if current_mode_select.current.value == 'local':
if not mm.is_model_loaded() or (isinstance(fileOrBytes, str) and not fileOrBytes.endswith('.mp3')):
print("DEBUG: can't transcribe a non-MP3 file or while no model is loaded")
return
print(f"DEBUG: starting transcription")
output_text_container.current.alignment = ft.alignment.center
output_text_col.current.controls = [ft.ProgressRing()]
# set all transcribe buttons to disabled
for btn in transcribe_buttons:
btn.current.disabled = True
page.update()
try:
if isinstance(fileOrBytes, str):
segments, info = mm.transcribe_from_file(fileOrBytes)
else:
segments, info = mm.transcribe_from_i16_audio(fileOrBytes)
txt = ''
for seg in segments:
txt += seg.text + '\n'
output_text_container.current.alignment = ft.alignment.top_left
output_text_col.current.controls = [ft.Text(txt, selectable=True)] # TODO
except Exception as e:
output_text_container.current.alignment = ft.alignment.center
output_text_col.current.controls = [ft.Text(f"Transcribing failed: {str(e)}")] # TODO
finally:
# set all transcribe buttons to disabled
for btn in transcribe_buttons:
btn.current.disabled = False
page.update()
# === WEBSERVICE MODE CODE ===
elif current_mode_select.current.value == 'webservice':
url = whisper_webservice_url_input.current.value
print(f"DEBUG: starting web transcription")
if validators.url(url, simple_host=True):
output_text_container.current.alignment = ft.alignment.center
output_text_col.current.controls = [ft.ProgressRing()]
# set all transcribe buttons to disabled
for btn in transcribe_buttons:
btn.current.disabled = True
page.update()
try:
print(f'DEBUG: sending web request...')
code, text = whisper_webservice_interface.send_asr_request(url, fileOrBytes, task="transcribe")
except requests.exceptions.RequestException as e:
output_text_container.current.alignment = ft.alignment.center
print(f'web transcription failed: {str(e)}')
output_text_col.current.controls = \
[ft.Text(f"HTTP Request to {url}/asr failed. Reason:\n{str(e)}")]
# set all transcribe buttons to enabled
for btn in transcribe_buttons:
btn.current.disabled = False
page.update()
return
# set all transcribe buttons to enabled
for btn in transcribe_buttons:
btn.current.disabled = False
if code == 200:
output_text_container.current.alignment = ft.alignment.top_left
output_text_col.current.controls = [ft.Text(text, selectable=True)]
else:
output_text_container.current.alignment = ft.alignment.center
output_text_col.current.controls = \
[ft.Text(f"HTTP Request to {url}/asr failed ({code}):\n{text}")]
page.update()
def generate_file_tree(path: str, tree_dict: dict | DefaultDict):
if path[-1] == os.sep:
path = path[:-1]
@ -67,7 +195,7 @@ def main(page):
for file in tree_dict[utils.FILES_KEY]:
control = [ft.Text(file)]
if not file.endswith('.mp3'):
continue
@ -99,49 +227,19 @@ def main(page):
_button_ref = ft.Ref[ft.IconButton]()
control.append(ft.IconButton(icon=ft.icons.PLAY_CIRCLE_OUTLINED, ref=_button_ref,
on_click=lambda _, f=full_file_path, r=_button_ref: start_playing(f, r)))
def transcribe(filepath: str):
print(f"DEBUG: trying to transcribe file {filepath}")
if not mm.is_model_loaded() or not filepath.endswith('.mp3'):
return
print(f"DEBUG: starting transcription")
output_text_container.current.alignment = ft.alignment.center
output_text_col.current.controls = [ft.ProgressRing()]
# set all transcribe buttons to disabled
for btn in transcribe_buttons:
btn.current.disabled = True
page.update()
try:
segments, info = mm.transcribe_from_file(filepath)
txt = ''
for seg in segments:
txt += seg.text + '\n'
output_text_container.current.alignment = ft.alignment.top_left
output_text_col.current.controls = [ft.Text(txt, selectable=True)] # TODO
except Exception as e:
output_text_container.current.alignment = ft.alignment.center
output_text_col.current.controls = [ft.Text(f"Transcribing failed: {str(e)}")] # TODO
finally:
# set all transcribe buttons to disabled
for btn in transcribe_buttons:
btn.current.disabled = False
page.update()
on_click=lambda _, f=full_file_path, r=_button_ref: start_playing(f, r)))
transcribe_button_ref = ft.Ref[ft.IconButton]()
control.append(ft.IconButton(icon=ft.icons.FORMAT_ALIGN_LEFT, disabled=not mm.is_model_loaded(), ref=transcribe_button_ref,
# check enabled
enabled = (current_mode_select.current.value == 'local' and mm.is_model_loaded()) or (
current_mode_select.current.value == 'webservice' and
validators.url(whisper_webservice_url_input.current.value, simple_host=True))
control.append(ft.IconButton(icon=ft.icons.FORMAT_ALIGN_LEFT, disabled=not enabled,
ref=transcribe_button_ref,
on_click=lambda _, f=full_file_path: transcribe(f)))
transcribe_buttons.append(transcribe_button_ref)
files_controls.append(ft.Row(control))
@ -155,15 +253,6 @@ def main(page):
]
)
def btn_click(e):
greetings.current.controls.append(
ft.Text(f"Hello, {first_name.current.value} {last_name.current.value}!")
)
first_name.current.value = ""
last_name.current.value = ""
page.update()
first_name.current.focus()
def on_dialog_result(e: ft.FilePickerResultEvent):
path = e.path
if path:
@ -182,18 +271,58 @@ def main(page):
page.update()
except e:
print("didn't work aaa") # TODO: fix
def load_model():
load_model_text.current.value = 'Loading... This may take a while.'
model_size_select.current.disabled = True
model_device_select.current.disabled = True
# model_bits_select.current.disabled = True
model_load_unload_button.current.disabled = True
model_loading_spinner.current.visible = True
def mode_select():
global transcribe_ready
if mm.is_model_loaded():
print("BUG: cannot change mode while model is loaded!")
return
next_mode = current_mode_select.current.value
if next_mode == 'local':
# enable model selects & loads
model_size_select.current.visible = True
model_device_select.current.visible = True
model_load_unload_button.current.visible = True
model_size_select.current.disabled = False
model_device_select.current.disabled = False
whisper_webservice_url_input.current.visible = False
for btn in transcribe_buttons:
btn.current.disabled = True
set_transcribe_ready(False)
elif next_mode == 'webservice':
# enable model selects & loads
model_size_select.current.visible = False
model_device_select.current.visible = False
model_load_unload_button.current.visible = False
model_size_select.current.disabled = True
model_device_select.current.disabled = True
model_load_unload_button.current.disabled = True
current_mode_info_text.current.value = 'Input the URL of the onerahmet/openai-whisper-asr-webservice docker container'
whisper_webservice_url_input.current.visible = True
whisper_webservice_url_input.current.disabled = False
on_url_input(None)
else:
raise Exception(f'BUG: Impossible mode {next_mode} received!')
page.update()
page.client_storage.set('selected_mode', next_mode)
def load_model():
current_mode_info_text.current.value = 'Loading... This may take a while.'
page.update()
paralyze_ui()
try:
mm.set_model(
size=model_size_select.current.value or 'base',
@ -203,55 +332,165 @@ def main(page):
except Exception as e:
print(f"loading model failed. Exception: {str(e)}")
print(traceback.format_exc())
load_model_text.current.value = f'Loading failed. Reason:\n{str(e)}'
model_size_select.current.disabled = False
model_device_select.current.disabled = False
# model_bits_select.current.disabled = False
current_mode_info_text.current.value = f'Loading failed. Reason:\n{str(e)}'
set_transcribe_ready(False)
# raise e
model_loading_spinner.current.visible = False
model_load_unload_button.current.disabled = False
processing_spinner.current.visible = False
if mm.is_model_loaded():
load_model_text.current.value = f'Loaded.'
model_load_unload_button.current.icon = ft.icons.CLOSE
model_load_unload_button.current.on_click = lambda _: unload_model()
current_mode_info_text.current.value = f'Loaded.'
# if successful, save to shared preferences
page.client_storage.set('model_size', model_size_select.current.value)
page.client_storage.set('device_select', model_device_select.current.value)
# set all transcribe buttons to enabled
for btn in transcribe_buttons:
btn.current.disabled = False
page.update()
set_transcribe_ready(True)
else:
set_transcribe_ready(False)
def unload_model():
model_load_unload_button.current.disabled = True
# set all transcribe buttons to disabled
for btn in transcribe_buttons:
btn.current.disabled = True
page.update()
paralyze_ui()
if mm.is_model_loaded():
mm.unload_model()
load_model_text.current.value = 'Select parameters, and then load transcription model.'
model_size_select.current.disabled = False
model_device_select.current.disabled = False
# model_bits_select.current.disabled = False
set_transcribe_ready(False)
def paralyze_ui(spinner: bool = True, disable_recording_button: bool = True):
model_size_select.current.disabled = True
model_device_select.current.disabled = True
# model_bits_select.current.disabled = True
model_load_unload_button.current.disabled = True
processing_spinner.current.visible = spinner
current_mode_select.current.disabled = True
record_button.current.disabled = disable_recording_button
model_load_unload_button.current.icon = ft.icons.CLOSE
model_load_unload_button.current.disabled = False
model_load_unload_button.current.icon = ft.icons.START
model_load_unload_button.current.on_click = lambda _: load_model()
model_loading_spinner.current.visible = False
for btn in transcribe_buttons:
btn.current.disabled = True
model_load_unload_button.current.disabled = True
page.update()
def set_transcribe_ready(rdy: bool):
global transcribe_ready
transcribe_ready = rdy
if transcribe_ready:
for btn in transcribe_buttons:
btn.current.disabled = False
model_size_select.current.disabled = True
model_device_select.current.disabled = True
# model_bits_select.current.disabled = True
model_load_unload_button.current.disabled = True
processing_spinner.current.visible = False
model_load_unload_button.current.on_click = lambda _: unload_model()
model_load_unload_button.current.icon = ft.icons.CLOSE
model_load_unload_button.current.disabled = False
record_button.current.disabled = False
if mm.is_model_loaded():
current_mode_select.current.disabled = True
else:
for btn in transcribe_buttons:
btn.current.disabled = True
model_size_select.current.disabled = False
model_device_select.current.disabled = False
# model_bits_select.current.disabled = False
model_load_unload_button.current.disabled = False
model_load_unload_button.current.icon = ft.icons.START
model_load_unload_button.current.on_click = lambda _: load_model()
processing_spinner.current.visible = False
current_mode_select.current.disabled = False
record_button.current.disabled = True
page.update()
def on_url_input(e):
url_value = whisper_webservice_url_input.current.value
# print(url_value)
if validators.url(url_value, simple_host=True):
# print('valid')
page.client_storage.set('webservice_url', url_value)
# set all transcribe buttons to enabled
set_transcribe_ready(True)
else:
# print('invalid')
# set all transcribe buttons to disabled
set_transcribe_ready(False)
page.update()
print(tuple(page.client_storage.get('selected_mic')))
def toggle_recording():
global recording
global rec_stream
global sound_chunks
global recorded_audio
if recording:
print("Stopping recording...")
rec_stream.stop_stream()
while not rec_stream.is_stopped():
pass # wait until stopped
recorded_audio = b"".join(sound_chunks)
set_transcribe_ready(False)
transcribe(recorded_audio)
recording = False
# sound = pygame.mixer.Sound(buffer=recorded_audio) # doesn't work because sampling rate is wrong
record_button.current.bgcolor = "0x000000FF"
set_transcribe_ready(True)
print("done")
# sound.play()
else:
if not transcribe_ready:
print("Can't record, not ready")
return
print("Starting Recording...")
recording = True
sound_chunks = []
def cb(in_data, _frame_count, _time_info, _status):
sound_chunks.append(in_data)
print(_time_info)
return in_data, pyaudio.paContinue
rec_stream = p.open(
format=REC_FORMAT,
channels=REC_CHANNELS,
rate=REC_RATE,
input=True,
frames_per_buffer=REC_CHUNK,
stream_callback=cb
)
rec_stream.start_stream()
record_button.current.bgcolor = "0xFFFF4444"
paralyze_ui(spinner=False, disable_recording_button=False)
def find_recordingdevice_tuple_by_name(search_name: str) -> typing.Tuple[int, str] | None:
return next(((device_id, name) for device_id, name in capture_devices if name == search_name))
# set up file picker
file_picker = ft.FilePicker(on_result=on_dialog_result)
@ -263,11 +502,29 @@ def main(page):
ft.Divider()
)
mode = page.client_storage.get('selected_mode') if page.client_storage.contains_key('selected_mode') else 'local'
page.add(
ft.ResponsiveRow([
ft.Container(
ft.Column([
ft.ElevatedButton("Add Folder", on_click=lambda _: file_picker.get_directory_path()),
ft.Row([
ft.ElevatedButton("Add Folder", on_click=lambda _: file_picker.get_directory_path()),
ft.Container(expand=True),
ft.IconButton(ft.icons.RECORD_VOICE_OVER, ref=record_button,
on_click=lambda _: toggle_recording()),
]),
ft.Dropdown(
ref=mic_select,
options=[ft.dropdown.Option(x[1]) for x in capture_devices],
value=page.client_storage.get('selected_mic')[1] if (
page.client_storage.contains_key('selected_mic') and tuple(
page.client_storage.get('selected_mic')) in capture_devices) else capture_devices[0][1],
height=36,
content_padding=2,
on_change=lambda _: page.client_storage.set('selected_mic', find_recordingdevice_tuple_by_name(
mic_select.current.value)) if mic_select.current.value else None
),
ft.Column(ref=file_tree, scroll=ft.ScrollMode.ALWAYS, expand=True),
# ft.ListView(ref=file_tree),
ft.Text("No Folder Open Yet", style=ft.TextTheme.body_small, color="grey",
@ -275,21 +532,44 @@ def main(page):
], expand=True), expand=True, col=4),
ft.Container(expand=True, content=ft.Column(expand=True, controls=[
ft.Column([
ft.Text('Select parameters, and then load transcription model.', ref=load_model_text),
ft.Text(
'Select parameters, and then load transcription model.'
if mode == 'local'
else 'Input the URL of the onerahmet/openai-whisper-asr-webservice docker container'
, ref=current_mode_info_text),
ft.Row([
ft.Dropdown(
ref=current_mode_select,
width=160,
hint_text='mode',
value=mode,
on_change=lambda _: mode_select(),
options=[
ft.dropdown.Option('local'),
ft.dropdown.Option('webservice'),
],
),
# === LOCAL MODE ===
ft.Dropdown(
ref=model_size_select,
width=100,
hint_text='model size',
value=page.client_storage.get('model_size') if page.client_storage.contains_key('model_size') else 'base',
options=[ft.dropdown.Option(x) for x in mm.ModelSize.__args__], # __args__ is not perfect here. But works.
value=page.client_storage.get('model_size') if page.client_storage.contains_key(
'model_size') else 'base',
options=[ft.dropdown.Option(x) for x in mm.ModelSize.__args__],
# __args__ is not perfect here. But works.
visible=mode == 'local',
),
ft.Dropdown(
ref=model_device_select,
width=100,
hint_text='device',
value=page.client_storage.get('device_select') if page.client_storage.contains_key('device_select') else 'auto',
options=[ft.dropdown.Option(x) for x in mm.Device.__args__] # __args__ is not perfect here. But works.
value=page.client_storage.get('device_select') if page.client_storage.contains_key(
'device_select') else 'auto',
options=[ft.dropdown.Option(x) for x in mm.Device.__args__],
visible=mode == 'local',
# __args__ is not perfect here. But works.
),
# ft.Dropdown(
# ref=model_bits_select,
@ -297,26 +577,42 @@ def main(page):
# hint_text='bits',
# value='16bit',
# options=[ft.dropdown.Option(x) for x in mm.ComputeType.__args__] # __args__ is not perfect here. But works.
#),
# ),
ft.IconButton(
icon=ft.icons.START,
ref=model_load_unload_button,
on_click=lambda _: load_model(),
visible=mode == 'local',
),
ft.ProgressRing(ref=model_loading_spinner, visible=False)
# === WEBSERVICE MODE ===
ft.TextField(
ref=whisper_webservice_url_input,
visible=mode == 'webservice',
on_change=on_url_input,
hint_text='e.g. http://localhost:9000',
value=page.client_storage.get('webservice_url') if page.client_storage.contains_key(
'webservice_url') else '',
),
# TODO: question mark hint button about what the web service is
# === GENERAL ===
ft.ProgressRing(ref=processing_spinner, visible=False)
])
]),
ft.Container(expand=True, padding=12, border=ft.border.all(2, 'grey'),
ft.Container(expand=True, padding=12, border=ft.border.all(2, 'grey'),
alignment=ft.alignment.center,
ref=output_text_container,
content=ft.Column(
[ft.Text('Nothing to see here!', text_align=ft.TextAlign.CENTER)],
ref=output_text_col,
expand=True,
scroll=ft.ScrollMode.ADAPTIVE)),
ref=output_text_col,
expand=True,
scroll=ft.ScrollMode.ADAPTIVE)),
]), col=8)
], expand=True),
)
# refresh all values, and make sure the right stuff is shown
mode_select()
ft.app(target=main)

37
main.spec Normal file
View File

@ -0,0 +1,37 @@
# -*- mode: python ; coding: utf-8 -*-
a = Analysis(
['main.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='main',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)

View File

@ -1,5 +1,7 @@
import io
import threading
import numpy as np
from faster_whisper import WhisperModel
import faster_whisper
from typing import Literal, Iterable, Tuple
@ -47,6 +49,30 @@ def is_model_loaded() -> bool:
return _model is not None
def transcribe_from_i16_audio(audio: bytes) -> Tuple[Iterable[
faster_whisper.transcribe.Segment], faster_whisper.transcribe.TranscriptionInfo] | None:
"""
Transcribe audio from an MP3 file.
Note that this can - and will - crash if you don't catch exceptions.
If the model isn't loaded yet, this will return None.
Otherwise, it will return the raw transcription from `faster-whisper`.
"""
if not is_model_loaded():
return None
data = np.frombuffer(audio, dtype=np.int16)
# Convert s16 to f32.
data = data.astype(np.float32) / 32768.0
global _model
segments, info = _model.transcribe(data, beam_size=5)
# transcribe, and throw all exceptions to application to handle
return segments, info
def transcribe_from_file(mp3_path: str) -> Tuple[Iterable[faster_whisper.transcribe.Segment], faster_whisper.transcribe.TranscriptionInfo] | None:
"""
Transcribe audio from an MP3 file.

7
openapitools.json Normal file
View File

@ -0,0 +1,7 @@
{
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "7.0.1"
}
}

1407
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -7,11 +7,15 @@ license = "MIT"
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.11"
python = ">=3.11, <3.13"
flet = "^0.10.3"
faster-whisper = "^0.9.0"
faster-whisper = "0.10.0"
pygame = "^2.5.2"
torch = "2.0.0"
requests = "^2.31.0"
validators = "^0.22.0"
pyinstaller = "^6.1.0"
pyaudio = "^0.2.13"
pydub = "^0.25.1"
[build-system]

View File

@ -3,6 +3,9 @@ import os
from typing import DefaultDict, Dict, List
from pydub import AudioSegment
import io
def tree() -> DefaultDict:
return defaultdict(tree)
@ -44,3 +47,15 @@ def defaultdict_to_dict(d: defaultdict) -> dict:
if isinstance(d, defaultdict):
d = {k: defaultdict_to_dict(v) for k, v in d.items()}
return d
def convert_to_mp3(audio_data: bytes, sample_width: int, frame_rate: int, channels: int) -> bytes:
audio = AudioSegment.from_raw(
io.BytesIO(audio_data),
sample_width=sample_width,
frame_rate=frame_rate,
channels=channels
)
mp3_buffer = io.BytesIO()
audio.export(mp3_buffer, format="mp3")
return mp3_buffer.getvalue()

View File

@ -0,0 +1,86 @@
from typing import Optional, Union, Dict, Any
import requests
from utils import convert_to_mp3
def send_asr_request(url: str, audio_file_path_or_bytes: str | bytes, task: Optional[str] = None, language: Optional[str] = None,
initial_prompt: Optional[str] = None, encode: Optional[bool] = None,
output: Optional[str] = None, word_timestamps: Optional[bool] = None) -> tuple[int, str]:
"""
Send a request to the ASR endpoint.
Returns the text represented by the audio file if everything worked out,
and a tuple of the form (status_code, response_text) otherwise
"""
endpoint = f"{url}/asr"
params = {
"task": task,
"language": language,
"initial_prompt": initial_prompt,
"encode": encode,
"output": output,
"word_timestamps": word_timestamps
}
params = {k: v for k, v in params.items() if v is not None}
if isinstance(audio_file_path_or_bytes, str):
with open(audio_file_path_or_bytes, 'rb') as f:
audio_file = f.read()
else:
audio_file = convert_to_mp3(audio_file_path_or_bytes, sample_width=2, frame_rate=16000, channels=1)
files = {
'audio_file': audio_file
}
response = requests.post(endpoint, params=params, files=files)
return response.status_code, response.text
def detect_language(url: str, audio_file_path: str, encode: Optional[bool] = None) -> Dict[str, Any] | tuple[int, str]:
"""
Send a request to the Detect Language endpoint.
Returns either a dictionary of the form {'detected_language': '<LANG>', 'language_code': '<LANG_CODE>'} if the request
was successful, or a tuple of the form (status_code, response_text) otherwise.
"""
endpoint = f"{url}/detect-language"
params = {
"encode": encode
}
params = {k: v for k, v in params.items() if v is not None}
with open(audio_file_path, 'rb') as f:
audio_file = f.read()
files = {
'audio_file': audio_file
}
response = requests.post(endpoint, params=params, files=files)
if response.status_code == 200:
return response.json()
else:
return response.status_code, response.text
# Example usage
def main():
url = "http://127.0.0.1:9000" # Replace with the actual URL of the webservice
audio_file_path = "/run/media/yannik/IC RECORDER/REC_FILE/Interview01/231021_1541.mp3"
response = send_asr_request(url, audio_file_path, task="transcribe", language="en")
print(response)
response = detect_language(url, audio_file_path)
print(response)
if __name__ == "__main__":
main()