florence-forge-webui / pyproject.toml
isLinXu
fix(deploy): 锁定 gradio 依赖版本修复 HF Spaces 模板兼容性错误
ae9e22c
Raw
History Blame Contribute Delete
7.74 kB
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "florence-forge"
version = "1.0.0"
authors = [
{name = "FlorenceForge Contributors", email = "contact@florenceforge.ai"},
]
maintainers = [
{name = "FlorenceForge Team", email = "contact@florenceforge.ai"},
]
description = "A comprehensive framework for fine-tuning Florence-2 models on multiple vision-language tasks"
readme = "README.md"
requires-python = ">=3.8"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Multimedia :: Graphics :: Graphics Conversion",
"Topic :: Text Processing :: Linguistic",
]
keywords = [
"florence-2",
"computer-vision",
"natural-language-processing",
"multi-task-learning",
"fine-tuning",
"transformers",
"pytorch",
"machine-learning",
"deep-learning",
"vision-language",
"image-captioning",
"object-detection",
"ocr",
"visual-question-answering",
]
license = {text = "MIT"}
dependencies = [
"torch>=2.0.0,<3.0.0",
"torchvision>=0.15.0,<1.0.0",
"transformers>=4.35.0,<5.0.0",
"accelerate>=0.24.0,<2.0.0",
"peft>=0.6.0,<1.0.0",
"datasets>=2.14.0,<5.0.0",
"einops>=0.6.0,<1.0.0",
"Pillow>=9.0.0,<11.0.0",
"opencv-python>=4.8.0,<5.0.0",
"numpy>=1.21.0,<3.0.0",
"pandas>=1.5.0,<3.0.0",
"scipy>=1.9.0,<2.0.0",
"PyYAML>=6.0,<7.0",
"fastapi>=0.104.0,<0.116.0", # 上界对齐 starlette<0.41,避免 gradio 模板兼容性 bug
"uvicorn[standard]>=0.24.0,<1.0.0",
"pydantic>=2.4.0,<3.0.0",
"tqdm>=4.64.0,<5.0.0",
"rich>=13.0.0,<16.0.0",
"matplotlib>=3.6.0,<4.0.0",
"scikit-learn>=1.3.0,<2.0.0",
"requests>=2.28.0,<3.0.0",
"click>=8.1.0,<9.0.0",
"psutil>=5.9.0,<6.0.0",
]
[project.optional-dependencies]
dev = [
"pytest>=7.0.0,<8.0.0",
"pytest-asyncio>=0.21.0,<1.0.0",
"pytest-cov>=4.0.0,<5.0.0",
"black>=23.0.0,<24.0.0",
"isort>=5.12.0,<6.0.0",
"flake8>=6.0.0,<7.0.0",
"mypy>=1.5.0,<2.0.0",
"types-PyYAML>=6.0.0",
"pre-commit>=3.3.0,<4.0.0",
]
evaluation = [
"nltk>=3.8,<4.0",
"rouge-score>=0.1.2,<1.0.0",
"pycocotools>=2.0.7,<3.0.0",
"sacrebleu>=2.3.0,<3.0.0",
]
docs = [
"sphinx>=7.0.0,<8.0.0",
"sphinx-rtd-theme>=1.3.0,<2.0.0",
"mkdocs>=1.5.0,<2.0.0",
"mkdocs-material>=9.0.0,<10.0.0",
]
jupyter = [
"jupyter>=1.0.0,<2.0.0",
"ipywidgets>=8.0.0,<9.0.0",
"notebook>=6.5.0,<8.0.0",
]
demo = [
"gradio>=3.50.0,<5.0.0",
"streamlit>=1.28.0,<2.0.0",
]
cloud = [
"boto3>=1.28.0,<2.0.0",
"azure-storage-blob>=12.17.0,<13.0.0",
"google-cloud-storage>=2.10.0,<3.0.0",
]
performance = [
"numba>=0.57.0,<1.0.0",
"memory-profiler>=0.61.0,<1.0.0",
"line-profiler>=4.0.0,<5.0.0",
]
all = [
"florence-forge[dev,evaluation,docs,jupyter,demo,cloud,performance]",
]
[project.urls]
Homepage = "https://github.com/florenceforge/florence-forge"
Documentation = "https://florence-forge.readthedocs.io/"
Repository = "https://github.com/florenceforge/florence-forge"
"Bug Tracker" = "https://github.com/florenceforge/florence-forge/issues"
Changelog = "https://github.com/florenceforge/florence-forge/blob/main/CHANGELOG.md"
[project.scripts]
florence_forge_cli = "florence_forge.cli.main:main"
florence-forge = "florence_forge.cli.main:main"
# 子命令通过主 CLI 的 subcommand 实现,不使用独立入口点
# florence-train, florence-evaluate, florence-serve, florence-convert, florence-infer
[tool.setuptools]
include-package-data = true
[tool.setuptools.packages.find]
where = ["."]
include = ["florence_forge*"]
exclude = ["tests*", "examples*"]
[tool.setuptools.package-data]
florence_forge = [
"configs/*.yaml",
"configs/**/*.yaml",
"templates/*.yaml",
"templates/**/*.yaml",
"assets/*",
"assets/**/*",
]
# Black configuration
[tool.black]
line-length = 88
target-version = ['py38', 'py39', 'py310', 'py311', 'py312']
include = '\.pyi?$'
extend-exclude = '''
(
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
)
'''
# isort configuration
[tool.isort]
profile = "black"
line_length = 88
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
# MyPy configuration
[tool.mypy]
python_version = "3.8"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = false
disallow_incomplete_defs = false
check_untyped_defs = false
disallow_untyped_decorators = false
no_implicit_optional = false
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = false
strict_equality = false
show_error_codes = true
pretty = true
exclude = [
"tests/",
"examples/",
"scripts/",
"docs/",
]
[[tool.mypy.overrides]]
module = [
"torch.*",
"torchvision.*",
"transformers.*",
"accelerate.*",
"peft.*",
"datasets.*",
"cv2.*",
"albumentations.*",
"wandb.*",
"tensorboard.*",
"gradio.*",
"streamlit.*",
"PIL.*",
"sklearn.*",
"tqdm.*",
"rich.*",
"matplotlib.*",
"scipy.*",
"pandas.*",
"numpy.*",
"psutil.*",
"click.*",
"fastapi.*",
"uvicorn.*",
"requests.*",
"yaml.*",
"reportlab.*",
"tensorboardX.*",
"decord.*",
"flash_attn.*",
"seaborn.*",
"plotly.*",
]
ignore_missing_imports = true
# Pytest configuration
[tool.pytest.ini_options]
minversion = "7.0"
addopts = "-ra -q --strict-markers --strict-config"
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
"unit: marks tests as unit tests",
"gpu: marks tests that require GPU",
]
filterwarnings = [
"ignore::UserWarning",
"ignore::DeprecationWarning",
]
# Coverage configuration
[tool.coverage.run]
source = ["florence_forge"]
omit = [
"*/tests/*",
"*/test_*",
"setup.py",
"*/examples/*",
]
[tool.coverage.report]
fail_under = 56
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "E402"]
"tests/*" = ["S101", "E402"]
"florence_forge/cli/config_manager.py" = ["E402"]
"florence_forge/core/model.py" = ["E402"]
"florence_forge/evaluation/advanced_metrics/*.py" = ["E402"]
"florence_forge/evaluation/analyzer_*.py" = ["E402"]
"florence_forge/examples/*.py" = ["E402"]
# Flake8 configuration
[tool.flake8]
max-line-length = 88
extend-ignore = ["E203", "W503"]
exclude = [
".git",
"__pycache__",
"build",
"dist",
".eggs",
"*.egg-info",
".venv",
".mypy_cache",
".pytest_cache",
]
per-file-ignores = [
"__init__.py:F401,E402",
"tests/*:S101",
]