Skip to content

Commit

Permalink
fix: whisper binary missing in package
Browse files Browse the repository at this point in the history
  • Loading branch information
chidiwilliams committed Jan 10, 2024
1 parent ab912de commit 5cda68a
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 32 deletions.
30 changes: 30 additions & 0 deletions .run/pytest.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="pytest" type="tests" factoryName="py.test" nameIsGenerated="true">
<module name="buzz" />
<option name="ENV_FILES" value="" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="$PROJECT_DIR$/.venv/bin/python" />
<option name="SDK_NAME" value="Poetry (buzz) (2)" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="net.ashald.envfile">
<option name="IS_ENABLED" value="false" />
<option name="IS_SUBST" value="false" />
<option name="IS_PATH_MACRO_SUPPORTED" value="false" />
<option name="IS_IGNORE_MISSING_FILES" value="false" />
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" />
<ENTRIES>
<ENTRY IS_ENABLED="true" PARSER="runconfig" IS_EXECUTABLE="false" />
</ENTRIES>
</EXTENSION>
<option name="_new_keywords" value="&quot;&quot;" />
<option name="_new_parameters" value="&quot;&quot;" />
<option name="_new_additionalArguments" value="&quot;-s&quot;" />
<option name="_new_target" value="&quot;&quot;" />
<option name="_new_targetType" value="&quot;CUSTOM&quot;" />
<method v="2" />
</configuration>
</component>
59 changes: 31 additions & 28 deletions Buzz.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,35 @@ import shutil

from PyInstaller.utils.hooks import collect_data_files, copy_metadata

This comment has been minimized.

Copy link
@dawnh609

dawnh609 Jan 21, 2024

pip install transcribe-anything

from buzz.__version__ import VERSION

datas = []
datas += collect_data_files('torch')
datas += copy_metadata('tqdm')
datas += copy_metadata('torch')
datas += copy_metadata('regex')
datas += copy_metadata('requests')
datas += copy_metadata('packaging')
datas += copy_metadata('filelock')
datas += copy_metadata('numpy')
datas += copy_metadata('tokenizers')
datas += collect_data_files("torch")
datas += copy_metadata("tqdm")
datas += copy_metadata("torch")
datas += copy_metadata("regex")
datas += copy_metadata("requests")
datas += copy_metadata("packaging")
datas += copy_metadata("filelock")
datas += copy_metadata("numpy")
datas += copy_metadata("tokenizers")

# Allow transformers package to load __init__.py file dynamically:
# https://github.com/chidiwilliams/buzz/issues/272
datas += collect_data_files('transformers', include_py_files=True)
datas += collect_data_files("transformers", include_py_files=True)

datas += collect_data_files('whisper')
datas += [(file[1], os.path.dirname(file[1])) for file in
Tree('./locale', prefix='locale', excludes=['*.po'])]
datas += [(shutil.which('ffmpeg'), '.')]
datas += collect_data_files("whisper")
datas += [
("buzz/whisper.dll" if platform.system() == "Windows" else "buzz/libwhisper.*", ".")
]
datas += [
(file[1], os.path.dirname(file[1]))
for file in Tree("./locale", prefix="locale", excludes=["*.po"])
]
datas += [(shutil.which("ffmpeg"), ".")]

block_cipher = None

a = Analysis(
['main.py'],
["main.py"],
pathex=[],
binaries=[],
datas=datas,
Expand All @@ -50,9 +53,9 @@ exe = EXE(
pyz,
a.scripts,
[],
icon='./assets/buzz.ico',
icon="./assets/buzz.ico",
exclude_binaries=True,
name='Buzz',
name="Buzz",
debug=True,
bootloader_ignore_signals=False,
strip=False,
Expand All @@ -72,17 +75,17 @@ coll = COLLECT(
strip=False,
upx=False,
upx_exclude=[],
name='Buzz',
name="Buzz",
)
app = BUNDLE(
coll,
name='Buzz.app',
icon='./assets/buzz.icns',
bundle_identifier='com.chidiwilliams.buzz',
version='0.8.4',
name="Buzz.app",
icon="./assets/buzz.icns",
bundle_identifier="com.chidiwilliams.buzz",
version="0.8.4",
info_plist={
'NSPrincipalClass': 'NSApplication',
'NSHighResolutionCapable': 'True',
'NSMicrophoneUsageDescription': 'Allow Buzz to record audio from your microphone.'
}
"NSPrincipalClass": "NSApplication",
"NSHighResolutionCapable": "True",
"NSMicrophoneUsageDescription": "Allow Buzz to record audio from your microphone.",
},
)
8 changes: 4 additions & 4 deletions buzz/widgets/import_url_dialog.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Optional

from PyQt6.QtCore import Qt, QRegularExpression
from PyQt6.QtWidgets import QDialog, QWidget, QDialogButtonBox, QVBoxLayout, QMessageBox
from PyQt6.QtWidgets import QDialog, QWidget, QDialogButtonBox, QMessageBox, QFormLayout

from buzz.locale import _
from buzz.widgets.line_edit import LineEdit
Expand All @@ -19,7 +19,7 @@ def __init__(self, parent: Optional[QWidget] = None):
self.setWindowTitle(_("Import URL"))

self.line_edit = LineEdit()
self.line_edit.setPlaceholderText(_("URL"))
self.line_edit.setPlaceholderText(_("https://example.com/audio.mp3"))
self.line_edit.setMinimumWidth(350)

self.button_box = QDialogButtonBox(
Expand All @@ -28,8 +28,8 @@ def __init__(self, parent: Optional[QWidget] = None):
self.button_box.accepted.connect(self.accept)
self.button_box.rejected.connect(self.reject)

self.layout = QVBoxLayout()
self.layout.addWidget(self.line_edit)
self.layout = QFormLayout()
self.layout.addRow(_("URL:"), self.line_edit)
self.layout.addWidget(self.button_box)
self.setLayout(self.layout)

Expand Down

0 comments on commit 5cda68a

Please sign in to comment.