1 Star 0 Fork 0

马永凡/buzz

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Buzz.spec 2.58 KB
一键复制 编辑 原始数据 按行查看 历史
Chidi Williams 提交于 2024-03-24 21:05 . feat: add macOS build (#711)
# -*- mode: python ; coding: utf-8 -*-
import os.path
import platform
import shutil
from PyInstaller.utils.hooks import collect_data_files, copy_metadata
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 += copy_metadata("huggingface-hub")
datas += copy_metadata("safetensors")
datas += copy_metadata("pyyaml")
# 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("whisper")
datas += [("buzz/assets/*", "assets")]
datas += [("buzz/locale", "locale")]
datas += [("buzz/schema.sql", ".")]
block_cipher = None
DEBUG = os.environ.get("PYINSTALLER_DEBUG", "").lower() in ["1", "true"]
if DEBUG:
options = [("v", None, "OPTION")]
else:
options = []
binaries = [
(
"buzz/whisper.dll" if platform.system() == "Windows" else "buzz/libwhisper.*",
".",
),
(shutil.which("ffmpeg"), "."),
(shutil.which("ffprobe"), "."),
]
a = Analysis(
["main.py"],
pathex=[],
binaries=binaries,
datas=datas,
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
options,
icon="./assets/buzz.ico",
exclude_binaries=True,
name="Buzz",
debug=DEBUG,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=DEBUG,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=os.environ.get("BUZZ_CODESIGN_IDENTITY"),
entitlements_file="entitlements.plist" if platform.system() == "Darwin" else None,
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=False,
upx_exclude=[],
name="Buzz",
)
app = BUNDLE(
coll,
name="Buzz.app",
icon="./assets/buzz.icns",
bundle_identifier="com.chidiwilliams.buzz",
version=VERSION,
info_plist={
"NSPrincipalClass": "NSApplication",
"NSHighResolutionCapable": "True",
"NSMicrophoneUsageDescription": "Allow Buzz to record audio from your microphone.",
},
)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ma-yongfan/buzz.git
git@gitee.com:ma-yongfan/buzz.git
ma-yongfan
buzz
buzz
main

搜索帮助