fix: resolve Jinja2 unhashable dict theme crash and loopback validation failure in Hugging Face Spaces
Browse files
app.py
CHANGED
|
@@ -122,12 +122,8 @@ try:
|
|
| 122 |
except Exception:
|
| 123 |
gradio_major = 4 # ๊ธฐ๋ณธ๊ฐ ๋ฐฑ์
|
| 124 |
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
secondary_hue="slate",
|
| 128 |
-
neutral_hue="slate",
|
| 129 |
-
font=[gr.themes.GoogleFont("Outfit"), "sans-serif"]
|
| 130 |
-
)
|
| 131 |
|
| 132 |
interface_kwargs = {
|
| 133 |
"fn": chat,
|
|
@@ -151,10 +147,8 @@ interface_kwargs = {
|
|
| 151 |
"cache_examples": False
|
| 152 |
}
|
| 153 |
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
"server_port": 7860
|
| 157 |
-
}
|
| 158 |
|
| 159 |
# ๋ฒ์ ์ ๋ง์ถ ํ
๋ง ์ฃผ์
ํ์ดํ๋ผ์ธ
|
| 160 |
if gradio_major < 5:
|
|
|
|
| 122 |
except Exception:
|
| 123 |
gradio_major = 4 # ๊ธฐ๋ณธ๊ฐ ๋ฐฑ์
|
| 124 |
|
| 125 |
+
# Jinja2 ์ง๋ ฌํ ์๋ฌ(unhashable type: 'dict') ๋ฐฉ์ง๋ฅผ ์ํด ํ
๋ง๋ฅผ ๋ฌธ์์ด("soft")๋ก ์ ์
|
| 126 |
+
theme_obj = "soft"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 127 |
|
| 128 |
interface_kwargs = {
|
| 129 |
"fn": chat,
|
|
|
|
| 147 |
"cache_examples": False
|
| 148 |
}
|
| 149 |
|
| 150 |
+
# HF Spaces ์ปจํ
์ด๋ ๋ด ๋ฃจํ๋ฐฑ ๊ฒ์ฆ ์คํจ(ValueError) ์ฐํ๋ฅผ ์ํด launch ์ธ์ ์ต์ํ
|
| 151 |
+
launch_kwargs = {}
|
|
|
|
|
|
|
| 152 |
|
| 153 |
# ๋ฒ์ ์ ๋ง์ถ ํ
๋ง ์ฃผ์
ํ์ดํ๋ผ์ธ
|
| 154 |
if gradio_major < 5:
|