Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,33 +1,4 @@
|
|
| 1 |
-
|
| 2 |
-
validated_deps = []
|
| 3 |
-
problematic_versions = {
|
| 4 |
-
"opencv-python": {
|
| 5 |
-
"4.10.0": "4.10.0.84",
|
| 6 |
-
"4.10": "4.10.0.84",
|
| 7 |
-
"4.9.0": "4.9.0.80",
|
| 8 |
-
"4.8.0": "4.8.0.76"
|
| 9 |
-
},
|
| 10 |
-
"pillow": {
|
| 11 |
-
"10.0": "10.0.0",
|
| 12 |
-
"9.5": "9.5.0"
|
| 13 |
-
}
|
| 14 |
-
}
|
| 15 |
-
|
| 16 |
-
for dep in regular_deps:
|
| 17 |
-
pkg_name = dep.split("==")[0].split(">=")[0].strip()
|
| 18 |
-
if pkg_name in problematic_versions and "==" in dep:
|
| 19 |
-
version = dep.split("==")[1].strip()
|
| 20 |
-
if version in problematic_versions[pkg_name]:
|
| 21 |
-
new_version = problematic_versions[pkg_name][version]
|
| 22 |
-
new_dep = f"{pkg_name}>={new_version}"
|
| 23 |
-
validated_deps.append(new_dep)
|
| 24 |
-
yield f" → Fixed version: {dep} → {new_dep}"
|
| 25 |
-
else:
|
| 26 |
-
validated_deps.append(dep)
|
| 27 |
-
else:
|
| 28 |
-
validated_deps.append(dep)
|
| 29 |
-
|
| 30 |
-
regular_deps = validated_depsimport gradio as gr
|
| 31 |
from huggingface_hub import HfApi, create_repo
|
| 32 |
from git import Repo
|
| 33 |
import uuid
|
|
@@ -984,11 +955,40 @@ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-
|
|
| 984 |
|
| 985 |
# 2. 일반 의존성
|
| 986 |
if regular_deps:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 987 |
new_lines.append("# Core dependencies")
|
| 988 |
# opencv-python 중복 제거 확인
|
| 989 |
deduped_regular = []
|
| 990 |
seen = set()
|
| 991 |
-
for dep in sorted(
|
| 992 |
pkg_name = dep.split("==")[0].split(">=")[0].split("<=")[0].split(">")[0].split("<")[0].split("~=")[0].split("[")[0].strip()
|
| 993 |
if pkg_name not in seen:
|
| 994 |
deduped_regular.append(dep)
|
|
|
|
| 1 |
+
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
from huggingface_hub import HfApi, create_repo
|
| 3 |
from git import Repo
|
| 4 |
import uuid
|
|
|
|
| 955 |
|
| 956 |
# 2. 일반 의존성
|
| 957 |
if regular_deps:
|
| 958 |
+
# 추가 버전 검증 및 수정
|
| 959 |
+
validated_deps = []
|
| 960 |
+
problematic_versions = {
|
| 961 |
+
"opencv-python": {
|
| 962 |
+
"4.10.0": "4.10.0.84",
|
| 963 |
+
"4.10": "4.10.0.84",
|
| 964 |
+
"4.9.0": "4.9.0.80",
|
| 965 |
+
"4.8.0": "4.8.0.76"
|
| 966 |
+
},
|
| 967 |
+
"pillow": {
|
| 968 |
+
"10.0": "10.0.0",
|
| 969 |
+
"9.5": "9.5.0"
|
| 970 |
+
}
|
| 971 |
+
}
|
| 972 |
+
|
| 973 |
+
for dep in regular_deps:
|
| 974 |
+
pkg_name = dep.split("==")[0].split(">=")[0].strip()
|
| 975 |
+
if pkg_name in problematic_versions and "==" in dep:
|
| 976 |
+
version = dep.split("==")[1].strip()
|
| 977 |
+
if version in problematic_versions[pkg_name]:
|
| 978 |
+
new_version = problematic_versions[pkg_name][version]
|
| 979 |
+
new_dep = f"{pkg_name}>={new_version}"
|
| 980 |
+
validated_deps.append(new_dep)
|
| 981 |
+
yield f" → Fixed version: {dep} → {new_dep}"
|
| 982 |
+
else:
|
| 983 |
+
validated_deps.append(dep)
|
| 984 |
+
else:
|
| 985 |
+
validated_deps.append(dep)
|
| 986 |
+
|
| 987 |
new_lines.append("# Core dependencies")
|
| 988 |
# opencv-python 중복 제거 확인
|
| 989 |
deduped_regular = []
|
| 990 |
seen = set()
|
| 991 |
+
for dep in sorted(validated_deps):
|
| 992 |
pkg_name = dep.split("==")[0].split(">=")[0].split("<=")[0].split(">")[0].split("<")[0].split("~=")[0].split("[")[0].strip()
|
| 993 |
if pkg_name not in seen:
|
| 994 |
deduped_regular.append(dep)
|