Upload setup.py with huggingface_hub
Browse files
setup.py
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
# -*- coding: utf-8 -*-
|
| 3 |
+
"""
|
| 4 |
+
HOS Model Optimizer 安装脚本
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
from setuptools import setup, find_packages
|
| 8 |
+
from pathlib import Path
|
| 9 |
+
|
| 10 |
+
# 读取 README
|
| 11 |
+
this_directory = Path(__file__).parent
|
| 12 |
+
long_description = ""
|
| 13 |
+
if (this_directory / "README.md").exists():
|
| 14 |
+
long_description = (this_directory / "README.md").read_text(encoding="utf-8")
|
| 15 |
+
|
| 16 |
+
# 读取 requirements
|
| 17 |
+
def read_requirements(filename):
|
| 18 |
+
"""读取依赖文件"""
|
| 19 |
+
requirements = []
|
| 20 |
+
filepath = this_directory / filename
|
| 21 |
+
if filepath.exists():
|
| 22 |
+
with open(filepath, encoding="utf-8") as f:
|
| 23 |
+
for line in f:
|
| 24 |
+
line = line.strip()
|
| 25 |
+
if line and not line.startswith("#") and not line.startswith("-"):
|
| 26 |
+
requirements.append(line)
|
| 27 |
+
return requirements
|
| 28 |
+
|
| 29 |
+
setup(
|
| 30 |
+
name="hos-model-optimizer",
|
| 31 |
+
version="1.0.0",
|
| 32 |
+
author="HOS Team",
|
| 33 |
+
author_email="hos@example.com",
|
| 34 |
+
description="HOS 小模型优化工具",
|
| 35 |
+
long_description=long_description,
|
| 36 |
+
long_description_content_type="text/markdown",
|
| 37 |
+
url="https://github.com/hos-team/hos-model-optimizer",
|
| 38 |
+
packages=find_packages(),
|
| 39 |
+
classifiers=[
|
| 40 |
+
"Development Status :: 4 - Beta",
|
| 41 |
+
"Intended Audience :: Developers",
|
| 42 |
+
"Intended Audience :: Science/Research",
|
| 43 |
+
"License :: OSI Approved :: MIT License",
|
| 44 |
+
"Operating System :: OS Independent",
|
| 45 |
+
"Programming Language :: Python :: 3",
|
| 46 |
+
"Programming Language :: Python :: 3.8",
|
| 47 |
+
"Programming Language :: Python :: 3.9",
|
| 48 |
+
"Programming Language :: Python :: 3.10",
|
| 49 |
+
"Programming Language :: Python :: 3.11",
|
| 50 |
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
| 51 |
+
],
|
| 52 |
+
python_requires=">=3.8",
|
| 53 |
+
install_requires=[
|
| 54 |
+
"click>=8.0.0",
|
| 55 |
+
"pyyaml>=6.0",
|
| 56 |
+
"requests>=2.28.0",
|
| 57 |
+
"psutil>=5.9.0",
|
| 58 |
+
"torch>=2.0.0",
|
| 59 |
+
"transformers>=4.35.0",
|
| 60 |
+
"datasets>=2.14.0",
|
| 61 |
+
"peft>=0.5.0",
|
| 62 |
+
],
|
| 63 |
+
extras_require={
|
| 64 |
+
"quantization": [
|
| 65 |
+
"autoawq>=0.1.0",
|
| 66 |
+
"auto-gptq>=0.5.0",
|
| 67 |
+
"bitsandbytes>=0.41.0",
|
| 68 |
+
],
|
| 69 |
+
"inference": [
|
| 70 |
+
"llama-cpp-python>=0.2.0",
|
| 71 |
+
],
|
| 72 |
+
"vllm": [
|
| 73 |
+
"vllm>=0.2.0",
|
| 74 |
+
],
|
| 75 |
+
"sglang": [
|
| 76 |
+
"sglang>=0.1.0",
|
| 77 |
+
],
|
| 78 |
+
"training": [
|
| 79 |
+
"unsloth>=0.1.0",
|
| 80 |
+
],
|
| 81 |
+
"dev": [
|
| 82 |
+
"pytest>=7.0.0",
|
| 83 |
+
"black>=23.0.0",
|
| 84 |
+
"flake8>=6.0.0",
|
| 85 |
+
],
|
| 86 |
+
"all": [
|
| 87 |
+
"autoawq>=0.1.0",
|
| 88 |
+
"auto-gptq>=0.5.0",
|
| 89 |
+
"bitsandbytes>=0.41.0",
|
| 90 |
+
"llama-cpp-python>=0.2.0",
|
| 91 |
+
"vllm>=0.2.0",
|
| 92 |
+
"sglang>=0.1.0",
|
| 93 |
+
"unsloth>=0.1.0",
|
| 94 |
+
],
|
| 95 |
+
},
|
| 96 |
+
entry_points={
|
| 97 |
+
"console_scripts": [
|
| 98 |
+
"hos-quantize=hos_optimizer.cli:quantize_cmd",
|
| 99 |
+
"hos-infer=hos_optimizer.cli:infer_cmd",
|
| 100 |
+
"hos-train=hos_optimizer.cli:train_cmd",
|
| 101 |
+
"hos-merge=hos_optimizer.cli:merge_cmd",
|
| 102 |
+
"hos-deploy=hos_optimizer.cli:deploy_cmd",
|
| 103 |
+
"hos-config=hos_optimizer.cli:config_cmd",
|
| 104 |
+
"hos-optimizer=hos_optimizer.cli:main",
|
| 105 |
+
],
|
| 106 |
+
},
|
| 107 |
+
keywords="llm optimization quantization inference training deployment",
|
| 108 |
+
project_urls={
|
| 109 |
+
"Bug Reports": "https://github.com/hos-team/hos-model-optimizer/issues",
|
| 110 |
+
"Source": "https://github.com/hos-team/hos-model-optimizer",
|
| 111 |
+
},
|
| 112 |
+
)
|