mirror of
https://github.com/openai/whisper.git
synced 2025-11-24 06:26:03 +00:00
Merge bedda27faf967b6b55fd4495c483df33ab15dd66 into ba3f3cd54b0e5b8ce1ab3de13e32122d0d5f98ab
This commit is contained in:
commit
c2b0a9396e
34
setup.py
34
setup.py
@ -7,13 +7,30 @@ from setuptools import find_packages, setup
|
|||||||
|
|
||||||
|
|
||||||
def read_version(fname="whisper/version.py"):
|
def read_version(fname="whisper/version.py"):
|
||||||
exec(compile(open(fname, encoding="utf-8").read(), fname, "exec"))
|
try:
|
||||||
return locals()["__version__"]
|
exec(compile(open(fname, encoding="utf-8").read(), fname, "exec"))
|
||||||
|
return locals()["__version__"]
|
||||||
|
except FileNotFoundError:
|
||||||
|
print(f"Error: {fname} not found.")
|
||||||
|
sys.exit(1)
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Error reading version: {e}")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
requirements = []
|
def parse_requirements(filename):
|
||||||
if sys.platform.startswith("linux") and platform.machine() == "x86_64":
|
try:
|
||||||
requirements.append("triton>=2.0.0,<3")
|
with open(filename) as f:
|
||||||
|
return [str(r) for r in pkg_resources.parse_requirements(f)]
|
||||||
|
except FileNotFoundError:
|
||||||
|
print(f"Error: {filename} not found.")
|
||||||
|
sys.exit(1)
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Error parsing requirements: {e}")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
requirements_file = Path(__file__).with_name("requirements.txt")
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="openai-whisper",
|
name="openai-whisper",
|
||||||
@ -28,12 +45,7 @@ setup(
|
|||||||
url="https://github.com/openai/whisper",
|
url="https://github.com/openai/whisper",
|
||||||
license="MIT",
|
license="MIT",
|
||||||
packages=find_packages(exclude=["tests*"]),
|
packages=find_packages(exclude=["tests*"]),
|
||||||
install_requires=[
|
install_requires=parse_requirements(requirements_file),
|
||||||
str(r)
|
|
||||||
for r in pkg_resources.parse_requirements(
|
|
||||||
Path(__file__).with_name("requirements.txt").open()
|
|
||||||
)
|
|
||||||
],
|
|
||||||
entry_points={
|
entry_points={
|
||||||
"console_scripts": ["whisper=whisper.transcribe:cli"],
|
"console_scripts": ["whisper=whisper.transcribe:cli"],
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user