dev-yuje commited on
Commit
16a7f62
ยท
1 Parent(s): e471528

fix: resolve Jinja2 unhashable dict theme crash and loopback validation failure in Hugging Face Spaces

Browse files
Files changed (1) hide show
  1. app.py +4 -10
app.py CHANGED
@@ -122,12 +122,8 @@ try:
122
  except Exception:
123
  gradio_major = 4 # ๊ธฐ๋ณธ๊ฐ’ ๋ฐฑ์—…
124
 
125
- theme_obj = gr.themes.Soft(
126
- primary_hue="blue",
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
- launch_kwargs = {
155
- "server_name": "0.0.0.0",
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: