Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -111,11 +111,14 @@ def generate_design_image(prompt, seed=42, randomize_seed=True, width=1024, heig
|
|
111 |
|
112 |
# ์
๋ ฅ ํ
์คํธ ํด๋ฆฐ์ง ์ ์ฉ
|
113 |
prompt = clean_input_text(prompt)
|
114 |
-
|
115 |
-
#
|
|
|
|
|
116 |
|
117 |
if contains_korean(prompt):
|
118 |
-
|
|
|
119 |
prompt = translation[0]['translation_text']
|
120 |
translated = True
|
121 |
|
@@ -135,6 +138,7 @@ def generate_design_image(prompt, seed=42, randomize_seed=True, width=1024, heig
|
|
135 |
|
136 |
return image
|
137 |
|
|
|
138 |
##############################################################################
|
139 |
# ๋ก๊น
์ค์
|
140 |
##############################################################################
|
|
|
111 |
|
112 |
# ์
๋ ฅ ํ
์คํธ ํด๋ฆฐ์ง ์ ์ฉ
|
113 |
prompt = clean_input_text(prompt)
|
114 |
+
|
115 |
+
# ์ฌ์ ์ฒ๋ฆฌ: ์
๋ ฅ ํ
์คํธ๊ฐ ๋๋ฌด ๊ธธ๋ฉด ๋ฏธ๋ฆฌ ์๋ฅด๊ธฐ (์: 1000์ ์ด์์ด๋ฉด 1000์๋ก ์๋ผ๋)
|
116 |
+
if len(prompt) > 1000:
|
117 |
+
prompt = prompt[:1000]
|
118 |
|
119 |
if contains_korean(prompt):
|
120 |
+
# ๋ฒ์ญ ํธ์ถ ์ max_length์ truncation ์ต์
์ ์ถ๊ฐํ์ฌ ๊ธธ์ด ์ด๊ณผ ๋ฌธ์ ๋ฅผ ๋ฐฉ์ง
|
121 |
+
translation = translator(prompt, max_length=400, truncation=True)
|
122 |
prompt = translation[0]['translation_text']
|
123 |
translated = True
|
124 |
|
|
|
138 |
|
139 |
return image
|
140 |
|
141 |
+
|
142 |
##############################################################################
|
143 |
# ๋ก๊น
์ค์
|
144 |
##############################################################################
|