Toy
Claude
commited on
Commit
·
ba27a18
1
Parent(s):
7efd7d2
Fix Gradio compatibility issues for Python 3.9 on HF Spaces
Browse files- Downgrade Gradio to v4.43.0 (compatible with Python 3.9)
- Update Pillow constraint to allow newer versions
- Add automatic share=True for HF Spaces launches
- Regenerate requirements.txt with compatible versions
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
- app.py +3 -0
- pyproject.toml +2 -2
- requirements.txt +3 -3
- uv.lock +12 -12
app.py
CHANGED
@@ -72,6 +72,9 @@ class FlowerifyApp:
|
|
72 |
def launch(self, **kwargs):
|
73 |
"""Launch the application."""
|
74 |
demo = self.create_interface()
|
|
|
|
|
|
|
75 |
return demo.queue().launch(**kwargs)
|
76 |
|
77 |
def main():
|
|
|
72 |
def launch(self, **kwargs):
|
73 |
"""Launch the application."""
|
74 |
demo = self.create_interface()
|
75 |
+
# Add share=True for HF Spaces compatibility
|
76 |
+
if config.is_hf_spaces:
|
77 |
+
kwargs.setdefault('share', True)
|
78 |
return demo.queue().launch(**kwargs)
|
79 |
|
80 |
def main():
|
pyproject.toml
CHANGED
@@ -7,8 +7,8 @@ requires-python = ">=3.9"
|
|
7 |
dependencies = [
|
8 |
"accelerate>=1.10.1",
|
9 |
"diffusers>=0.35.1",
|
10 |
-
"gradio>=4.
|
11 |
-
"pillow>=8.0,<
|
12 |
"python-dotenv>=1.0.0",
|
13 |
"scikit-learn>=1.3.0,<1.6",
|
14 |
"torch>=2.8.0",
|
|
|
7 |
dependencies = [
|
8 |
"accelerate>=1.10.1",
|
9 |
"diffusers>=0.35.1",
|
10 |
+
"gradio>=4.40.0,<4.44.0",
|
11 |
+
"pillow>=8.0,<12.0",
|
12 |
"python-dotenv>=1.0.0",
|
13 |
"scikit-learn>=1.3.0,<1.6",
|
14 |
"torch>=2.8.0",
|
requirements.txt
CHANGED
@@ -48,7 +48,7 @@ distlib==0.4.0
|
|
48 |
# via virtualenv
|
49 |
exceptiongroup==1.3.0 ; python_full_version < '3.11'
|
50 |
# via anyio
|
51 |
-
fastapi==0.
|
52 |
# via gradio
|
53 |
ffmpy==0.6.1
|
54 |
# via gradio
|
@@ -66,7 +66,7 @@ fsspec==2025.7.0
|
|
66 |
# gradio-client
|
67 |
# huggingface-hub
|
68 |
# torch
|
69 |
-
gradio==4.
|
70 |
# via flowerfy
|
71 |
gradio-client==1.3.0
|
72 |
# via gradio
|
@@ -308,7 +308,7 @@ six==1.17.0
|
|
308 |
# via python-dateutil
|
309 |
sniffio==1.3.1
|
310 |
# via anyio
|
311 |
-
starlette==0.
|
312 |
# via fastapi
|
313 |
sympy==1.14.0
|
314 |
# via torch
|
|
|
48 |
# via virtualenv
|
49 |
exceptiongroup==1.3.0 ; python_full_version < '3.11'
|
50 |
# via anyio
|
51 |
+
fastapi==0.112.4
|
52 |
# via gradio
|
53 |
ffmpy==0.6.1
|
54 |
# via gradio
|
|
|
66 |
# gradio-client
|
67 |
# huggingface-hub
|
68 |
# torch
|
69 |
+
gradio==4.43.0
|
70 |
# via flowerfy
|
71 |
gradio-client==1.3.0
|
72 |
# via gradio
|
|
|
308 |
# via python-dateutil
|
309 |
sniffio==1.3.1
|
310 |
# via anyio
|
311 |
+
starlette==0.38.6
|
312 |
# via fastapi
|
313 |
sympy==1.14.0
|
314 |
# via torch
|
uv.lock
CHANGED
@@ -482,16 +482,16 @@ wheels = [
|
|
482 |
|
483 |
[[package]]
|
484 |
name = "fastapi"
|
485 |
-
version = "0.
|
486 |
source = { registry = "https://pypi.org/simple" }
|
487 |
dependencies = [
|
488 |
{ name = "pydantic" },
|
489 |
{ name = "starlette" },
|
490 |
{ name = "typing-extensions" },
|
491 |
]
|
492 |
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
493 |
wheels = [
|
494 |
-
{ url = "https://files.pythonhosted.org/packages/
|
495 |
]
|
496 |
|
497 |
[[package]]
|
@@ -539,8 +539,8 @@ dev = [
|
|
539 |
requires-dist = [
|
540 |
{ name = "accelerate", specifier = ">=1.10.1" },
|
541 |
{ name = "diffusers", specifier = ">=0.35.1" },
|
542 |
-
{ name = "gradio", specifier = ">=4.
|
543 |
-
{ name = "pillow", specifier = ">=8.0,<
|
544 |
{ name = "python-dotenv", specifier = ">=1.0.0" },
|
545 |
{ name = "scikit-learn", specifier = ">=1.3.0,<1.6" },
|
546 |
{ name = "torch", specifier = ">=2.8.0" },
|
@@ -631,7 +631,7 @@ wheels = [
|
|
631 |
|
632 |
[[package]]
|
633 |
name = "gradio"
|
634 |
-
version = "4.
|
635 |
source = { registry = "https://pypi.org/simple" }
|
636 |
dependencies = [
|
637 |
{ name = "aiofiles" },
|
@@ -665,9 +665,9 @@ dependencies = [
|
|
665 |
{ name = "urllib3" },
|
666 |
{ name = "uvicorn", marker = "sys_platform != 'emscripten'" },
|
667 |
]
|
668 |
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
669 |
wheels = [
|
670 |
-
{ url = "https://files.pythonhosted.org/packages/
|
671 |
]
|
672 |
|
673 |
[[package]]
|
@@ -2667,15 +2667,15 @@ wheels = [
|
|
2667 |
|
2668 |
[[package]]
|
2669 |
name = "starlette"
|
2670 |
-
version = "0.
|
2671 |
source = { registry = "https://pypi.org/simple" }
|
2672 |
dependencies = [
|
2673 |
{ name = "anyio" },
|
2674 |
-
{ name = "typing-extensions", marker = "python_full_version < '3.
|
2675 |
]
|
2676 |
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
2677 |
wheels = [
|
2678 |
-
{ url = "https://files.pythonhosted.org/packages/
|
2679 |
]
|
2680 |
|
2681 |
[[package]]
|
|
|
482 |
|
483 |
[[package]]
|
484 |
name = "fastapi"
|
485 |
+
version = "0.112.4"
|
486 |
source = { registry = "https://pypi.org/simple" }
|
487 |
dependencies = [
|
488 |
{ name = "pydantic" },
|
489 |
{ name = "starlette" },
|
490 |
{ name = "typing-extensions" },
|
491 |
]
|
492 |
+
sdist = { url = "https://files.pythonhosted.org/packages/92/36/2eafe7d5ef26c1ae8e396cfcde3c9e9c50385f5c486dccdfba420d210c3d/fastapi-0.112.4.tar.gz", hash = "sha256:b1f72e1f72afe7902ccd639ba320abb5d57a309804f45c10ab0ce3693cadeb33", size = 292762, upload-time = "2024-09-05T15:07:26.269Z" }
|
493 |
wheels = [
|
494 |
+
{ url = "https://files.pythonhosted.org/packages/f5/cf/5b703250f4d85e86ec13ec28bb5ac36790092bfe45e94e414529371d6f11/fastapi-0.112.4-py3-none-any.whl", hash = "sha256:6d4f9c3301825d4620665cace8e2bc34e303f61c05a5382d1d61a048ea7f2f37", size = 93930, upload-time = "2024-09-05T15:07:24.877Z" },
|
495 |
]
|
496 |
|
497 |
[[package]]
|
|
|
539 |
requires-dist = [
|
540 |
{ name = "accelerate", specifier = ">=1.10.1" },
|
541 |
{ name = "diffusers", specifier = ">=0.35.1" },
|
542 |
+
{ name = "gradio", specifier = ">=4.40.0,<4.44.0" },
|
543 |
+
{ name = "pillow", specifier = ">=8.0,<12.0" },
|
544 |
{ name = "python-dotenv", specifier = ">=1.0.0" },
|
545 |
{ name = "scikit-learn", specifier = ">=1.3.0,<1.6" },
|
546 |
{ name = "torch", specifier = ">=2.8.0" },
|
|
|
631 |
|
632 |
[[package]]
|
633 |
name = "gradio"
|
634 |
+
version = "4.43.0"
|
635 |
source = { registry = "https://pypi.org/simple" }
|
636 |
dependencies = [
|
637 |
{ name = "aiofiles" },
|
|
|
665 |
{ name = "urllib3" },
|
666 |
{ name = "uvicorn", marker = "sys_platform != 'emscripten'" },
|
667 |
]
|
668 |
+
sdist = { url = "https://files.pythonhosted.org/packages/f1/aa/604fcd261714ae72d4c5cb2549f275a25a75570d08148c088560d4ebcd47/gradio-4.43.0.tar.gz", hash = "sha256:0d510e98b7fcb5d829fdc9452dcfef9f060c86130c9e85a539b9e709ba460823", size = 28307978, upload-time = "2024-09-06T01:22:53.512Z" }
|
669 |
wheels = [
|
670 |
+
{ url = "https://files.pythonhosted.org/packages/70/cd/b5a61e6c5fba0daad1b76dae9ebd0cc6e127be1cc20e19175ba6de2c9c3a/gradio-4.43.0-py3-none-any.whl", hash = "sha256:a8a785af95b7985d1d17287b1f79add3c913ed79180c4b89ef30cea375329bb9", size = 18067318, upload-time = "2024-09-06T01:22:49.102Z" },
|
671 |
]
|
672 |
|
673 |
[[package]]
|
|
|
2667 |
|
2668 |
[[package]]
|
2669 |
name = "starlette"
|
2670 |
+
version = "0.38.6"
|
2671 |
source = { registry = "https://pypi.org/simple" }
|
2672 |
dependencies = [
|
2673 |
{ name = "anyio" },
|
2674 |
+
{ name = "typing-extensions", marker = "python_full_version < '3.10'" },
|
2675 |
]
|
2676 |
+
sdist = { url = "https://files.pythonhosted.org/packages/42/b4/e25c3b688ef703d85e55017c6edd0cbf38e5770ab748234363d54ff0251a/starlette-0.38.6.tar.gz", hash = "sha256:863a1588f5574e70a821dadefb41e4881ea451a47a3cd1b4df359d4ffefe5ead", size = 2569491, upload-time = "2024-09-22T17:01:45.422Z" }
|
2677 |
wheels = [
|
2678 |
+
{ url = "https://files.pythonhosted.org/packages/b7/9c/93f7bc03ff03199074e81974cc148908ead60dcf189f68ba1761a0ee35cf/starlette-0.38.6-py3-none-any.whl", hash = "sha256:4517a1409e2e73ee4951214ba012052b9e16f60e90d73cfb06192c19203bbb05", size = 71451, upload-time = "2024-09-22T17:01:43.076Z" },
|
2679 |
]
|
2680 |
|
2681 |
[[package]]
|