Update app.py
Browse files
app.py
CHANGED
|
@@ -13,8 +13,10 @@ import tempfile
|
|
| 13 |
# ๊ณต๋ฐฑ/๊ฐํ์ด ์์ผ๋ฉด strip()์ผ๋ก ์ ๊ฑฐ
|
| 14 |
openai.api_key = os.getenv("OPENAI_API_KEY").strip()
|
| 15 |
|
|
|
|
|
|
|
|
|
|
| 16 |
def call_api(content, system_message, max_tokens, temperature, top_p):
|
| 17 |
-
# [api์๋ฃ]์์ ์ ๊ณต๋ ํจ์๋ฅผ ์ ๋ ์์ ํ๊ฑฐ๋ ์ญ์ ํ์ง ์์ต๋๋ค.
|
| 18 |
response = openai.ChatCompletion.create(
|
| 19 |
model="gpt-4o-mini", # gpt-4o-mini ๋ชจ๋ธ ์ฌ์ฉ
|
| 20 |
messages=[
|
|
@@ -28,20 +30,58 @@ def call_api(content, system_message, max_tokens, temperature, top_p):
|
|
| 28 |
return response.choices[0].message['content']
|
| 29 |
|
| 30 |
############################
|
| 31 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
############################
|
| 33 |
def analyze_financials(
|
| 34 |
-
avg_monthly_sales,
|
| 35 |
-
rent,
|
| 36 |
-
labor_cost,
|
| 37 |
-
management_cost,
|
| 38 |
-
utilities,
|
| 39 |
-
current_interest,
|
| 40 |
-
other_cost,
|
| 41 |
-
cost_ratio
|
| 42 |
):
|
| 43 |
"""
|
| 44 |
-
|
|
|
|
| 45 |
"""
|
| 46 |
system_message = (
|
| 47 |
"๋น์ ์ ์ธ๋ฌด์ฌ(ํ๊ณ์ฌ)์
๋๋ค. ์๋ ์
๋ ฅ๊ฐ์ ๋ฐํ์ผ๋ก ๊ณ์ฐํ ๊ฐ๊ฐ์๊ฐ๋น, ์์ด์ต์จ, "
|
|
@@ -74,11 +114,11 @@ def analyze_financials(
|
|
| 74 |
)
|
| 75 |
|
| 76 |
############################
|
| 77 |
-
# SWOT ๋ถ์ ํจ์
|
| 78 |
############################
|
| 79 |
def analyze_swot(strengths, weaknesses, opportunities, threats):
|
| 80 |
"""
|
| 81 |
-
|
| 82 |
"""
|
| 83 |
system_message = "๋น์ ์ swot ๋ถ์ ์ ๋ฌธ๊ฐ์
๋๋ค. ์ฌ์ฉ์์ ๊ฐ์ , ์ฝ์ , ๊ธฐํ, ์ํ์ ๋ํด ๊ฒ์ํ ๋ด์ฉ์ ์์ฝํ์ฌ ์ ๊ณตํฉ๋๋ค."
|
| 84 |
content = f"""
|
|
@@ -96,11 +136,12 @@ def analyze_swot(strengths, weaknesses, opportunities, threats):
|
|
| 96 |
)
|
| 97 |
|
| 98 |
############################
|
| 99 |
-
# ์๊ถ ๋ถ์ ํจ์ (6์ค ์ด๋ด)
|
| 100 |
############################
|
| 101 |
def analyze_market(region, industry):
|
| 102 |
"""
|
| 103 |
-
|
|
|
|
| 104 |
"""
|
| 105 |
system_message = (
|
| 106 |
"๋น์ ์ ์๊ถ๋ถ์ ์ ๋ฌธ๊ฐ์
๋๋ค. ์
๋ ฅ๋ ์ง์ญ๊ณผ ์
์ข
์ ๋ํด 1km ์ด๋ด ์๊ถ์ ๋ถ์ํด ์ฃผ์ธ์. "
|
|
@@ -119,16 +160,130 @@ def analyze_market(region, industry):
|
|
| 119 |
)
|
| 120 |
|
| 121 |
############################
|
| 122 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
############################
|
| 124 |
def export_swot_excel(strengths, weaknesses, opportunities, threats):
|
| 125 |
"""
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
- ์ํ โ D72:E72:F72:G72:H72
|
| 131 |
-
๊ฐ์ด๋ฐ ์ ๋ ฌ + wrap_text ์ ์ฉ
|
| 132 |
"""
|
| 133 |
wb = load_workbook("EXE.xlsx")
|
| 134 |
ws = wb.active
|
|
@@ -137,135 +292,271 @@ def export_swot_excel(strengths, weaknesses, opportunities, threats):
|
|
| 137 |
ws.merge_cells("D45:H45")
|
| 138 |
ws["D45"] = strengths
|
| 139 |
ws["D45"].alignment = Alignment(horizontal="center", vertical="center", wrap_text=True)
|
| 140 |
-
|
| 141 |
# ์ฝ์
|
| 142 |
ws.merge_cells("D54:H54")
|
| 143 |
ws["D54"] = weaknesses
|
| 144 |
ws["D54"].alignment = Alignment(horizontal="center", vertical="center", wrap_text=True)
|
| 145 |
-
|
| 146 |
# ๊ธฐํ
|
| 147 |
ws.merge_cells("D63:H63")
|
| 148 |
ws["D63"] = opportunities
|
| 149 |
ws["D63"].alignment = Alignment(horizontal="center", vertical="center", wrap_text=True)
|
| 150 |
-
|
| 151 |
# ์ํ
|
| 152 |
ws.merge_cells("D72:H72")
|
| 153 |
ws["D72"] = threats
|
| 154 |
ws["D72"].alignment = Alignment(horizontal="center", vertical="center", wrap_text=True)
|
| 155 |
|
| 156 |
-
# ์ ์ฅ
|
| 157 |
output = BytesIO()
|
| 158 |
wb.save(output)
|
| 159 |
output.seek(0)
|
| 160 |
-
|
| 161 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".xlsx") as tmp:
|
| 162 |
tmp.write(output.getvalue())
|
| 163 |
tmp.flush()
|
| 164 |
temp_file_path = tmp.name
|
| 165 |
-
|
| 166 |
final_path = os.path.join(os.path.dirname(temp_file_path), "EXE.xlsx")
|
| 167 |
os.rename(temp_file_path, final_path)
|
| 168 |
return final_path
|
| 169 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 170 |
def run_export_swot_excel(strengths, weaknesses, opportunities, threats):
|
| 171 |
-
"""
|
| 172 |
-
Gradio ์ด๋ฒคํธ ํจ์:
|
| 173 |
-
SWOT 4๊ฐ ์
๋ ฅ์ EXE.xlsx์ ์ฐ๊ณ , ํ์ผ ๊ฒฝ๋ก ๋ฐํ
|
| 174 |
-
"""
|
| 175 |
return export_swot_excel(strengths, weaknesses, opportunities, threats)
|
| 176 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 177 |
############################
|
| 178 |
# ๋จ์ผ ํ์ด์ง Gradio ์ฑ
|
| 179 |
############################
|
| 180 |
def main():
|
| 181 |
with gr.Blocks() as demo:
|
| 182 |
-
gr.Markdown("## ์ฌ๋ฌด
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 183 |
|
| 184 |
-
|
| 185 |
-
# (1) ์ฌ๋ฌด ๋ถ์
|
| 186 |
-
# ---------------------------
|
| 187 |
-
gr.Markdown("### ์ฌ๋ฌด ๋ถ์ (์
๋ ฅ์ ์๊ฐ์จ ํฌํจ, ๊ฒฐ๊ณผ์์ ์๊ฐ์จ ์ ์ธ)")
|
| 188 |
-
avg_monthly_sales_input = gr.Textbox(label="์ํ๊ท ๋งค์ถ์ก")
|
| 189 |
-
rent_input = gr.Textbox(label="์์ฐจ๋ฃ")
|
| 190 |
-
labor_cost_input = gr.Textbox(label="์ธ๊ฑด๋น")
|
| 191 |
-
management_cost_input = gr.Textbox(label="๊ด๋ฆฌ๋น")
|
| 192 |
-
utilities_input = gr.Textbox(label="์๋๊ด์ด๋น")
|
| 193 |
-
current_interest_input = gr.Textbox(label="์ง๊ธ์ด์")
|
| 194 |
-
other_cost_input = gr.Textbox(label="๊ธฐํ๋น์ฉ")
|
| 195 |
-
cost_ratio_input = gr.Textbox(label="์๊ฐ์จ")
|
| 196 |
|
| 197 |
-
|
| 198 |
-
|
|
|
|
|
|
|
| 199 |
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
],
|
| 213 |
-
outputs=result_output_fin
|
| 214 |
)
|
| 215 |
|
| 216 |
gr.Markdown("---")
|
| 217 |
|
| 218 |
-
# -------------------------
|
| 219 |
-
#
|
| 220 |
-
# -------------------------
|
| 221 |
-
gr.Markdown("###
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 222 |
|
| 223 |
strengths_input = gr.Textbox(label="๊ฐ์ ")
|
| 224 |
weaknesses_input = gr.Textbox(label="์ฝ์ ")
|
| 225 |
opportunities_input = gr.Textbox(label="๊ธฐํ")
|
| 226 |
threats_input = gr.Textbox(label="์ํ")
|
| 227 |
|
| 228 |
-
result_output_swot = gr.Textbox(label="SWOT ๊ฒ์ ๊ฒฐ๊ณผ")
|
| 229 |
analyze_button_swot = gr.Button("SWOT ๋ถ์ํ๊ธฐ")
|
|
|
|
| 230 |
|
| 231 |
-
# ๋ฒํผ ์ด๋ฒคํธ (SWOT ๋ถ์)
|
| 232 |
analyze_button_swot.click(
|
| 233 |
fn=analyze_swot,
|
| 234 |
inputs=[strengths_input, weaknesses_input, opportunities_input, threats_input],
|
| 235 |
outputs=result_output_swot
|
| 236 |
)
|
| 237 |
|
| 238 |
-
#
|
| 239 |
-
|
| 240 |
-
|
| 241 |
|
| 242 |
-
|
| 243 |
-
download_button_swot.click(
|
| 244 |
fn=run_export_swot_excel,
|
| 245 |
inputs=[strengths_input, weaknesses_input, opportunities_input, threats_input],
|
| 246 |
-
outputs=[
|
| 247 |
)
|
| 248 |
|
| 249 |
gr.Markdown("---")
|
| 250 |
|
| 251 |
-
# -------------------------
|
| 252 |
-
#
|
| 253 |
-
# -------------------------
|
| 254 |
-
gr.Markdown("###
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 255 |
|
| 256 |
region_input = gr.Textbox(label="์ง์ญ")
|
| 257 |
industry_input = gr.Textbox(label="์
์ข
")
|
| 258 |
-
|
| 259 |
result_output_market = gr.Textbox(label="์๊ถ๋ถ์ ๊ฒฐ๊ณผ (์ต๋ 6์ค)")
|
| 260 |
-
analyze_button_market = gr.Button("๋ถ์
|
| 261 |
|
| 262 |
-
# ๋ฒํผ ์ด๋ฒคํธ (์๊ถ ๋ถ์)
|
| 263 |
analyze_button_market.click(
|
| 264 |
-
fn=
|
| 265 |
inputs=[region_input, industry_input],
|
| 266 |
outputs=result_output_market
|
| 267 |
)
|
| 268 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 269 |
demo.launch()
|
| 270 |
|
| 271 |
if __name__ == "__main__":
|
|
|
|
| 13 |
# ๊ณต๋ฐฑ/๊ฐํ์ด ์์ผ๋ฉด strip()์ผ๋ก ์ ๊ฑฐ
|
| 14 |
openai.api_key = os.getenv("OPENAI_API_KEY").strip()
|
| 15 |
|
| 16 |
+
############################
|
| 17 |
+
# [api์๋ฃ]์์ ์ ๊ณต๋ ํจ์ (์์ ๊ธ์ง)
|
| 18 |
+
############################
|
| 19 |
def call_api(content, system_message, max_tokens, temperature, top_p):
|
|
|
|
| 20 |
response = openai.ChatCompletion.create(
|
| 21 |
model="gpt-4o-mini", # gpt-4o-mini ๋ชจ๋ธ ์ฌ์ฉ
|
| 22 |
messages=[
|
|
|
|
| 30 |
return response.choices[0].message['content']
|
| 31 |
|
| 32 |
############################
|
| 33 |
+
# (1) ์ ๋ก์ฌํญ/๋ชฉํ ๋ถ์ ํจ์
|
| 34 |
+
############################
|
| 35 |
+
def analyze_texts(difficulties, goals):
|
| 36 |
+
"""
|
| 37 |
+
- ์ฌ์ฉ์ ์
๋ ฅ(์ ๋ก์ฌํญ, ์ปจ์คํ
๋ชฉํ)์ ๋ํด gpt-4o-mini๋ก ๋ถ์
|
| 38 |
+
- ์ต์ 4์ค ์ด์, ๊ธ์ ์ค๊ฐ์ ๋์ง ์๊ณ '~์ต๋๋ค.' ํํ๋ก ์์ฐ์ค๋ฝ๊ฒ ๋.
|
| 39 |
+
"""
|
| 40 |
+
# ์ ๋ก์ฌํญ
|
| 41 |
+
preview_difficulties = call_api(
|
| 42 |
+
content=difficulties,
|
| 43 |
+
system_message=(
|
| 44 |
+
"์ฌ์ฉ์๊ฐ ์
๋ ฅํ ์ ๋ก์ฌํญ์ ์ต์ 4์ค ์ด์์ผ๋ก ๊ตฌ์ฒด์ ์ผ๋ก ์์ฑํด์ค. "
|
| 45 |
+
"๋ฌธ์ฅ์ ๊ธ์ ์ค๊ฐ์ ๋๊ฑฐ๋ ์๋ฅด์ง ๋ง๊ณ , ๋ถํ์ํ ๋์ด(์: ํ๋, ๋ ๋ฑ)์ "
|
| 46 |
+
"์ฌ์ฉํ์ง ๋ง๋ฉฐ, '~์ต๋๋ค.' ํํ๋ก ์์ฐ์ค๋ฝ๊ฒ ๋๋ด์ค. ํ์ํ๋ค๋ฉด ๊ธ์ด ๊ธธ์ด๋ ์ข์ผ๋ "
|
| 47 |
+
"์ค๊ฐ์ด ๋๊ธฐ์ง ์๋๋ก ์๋ฃ๋ ๋ฌธ์ฅ์ ์์ฑํด."
|
| 48 |
+
),
|
| 49 |
+
max_tokens=400,
|
| 50 |
+
temperature=0.7,
|
| 51 |
+
top_p=0.9,
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
# ์ปจ์คํ
๋ชฉํ
|
| 55 |
+
preview_goals = call_api(
|
| 56 |
+
content=goals,
|
| 57 |
+
system_message=(
|
| 58 |
+
"์ฌ์ฉ์๊ฐ ์
๋ ฅํ ์ปจ์คํ
๋ชฉํ๋ฅผ ์ต์ 4์ค ์ด์์ผ๋ก ๊ตฌ์ฒด์ ์ผ๋ก ์์ฑํด์ค. "
|
| 59 |
+
"๋ฌธ์ฅ์ ๊ธ์ ์ค๊ฐ์ ๋๊ฑฐ๋ ์๋ฅด์ง ๋ง๊ณ , ๋ถํ์ํ ๋์ด(์: ํ๋, ๋ ๋ฑ)์ "
|
| 60 |
+
"์ฌ์ฉํ์ง ๋ง๋ฉฐ, '~์ต๋๋ค.' ํํ๋ก ์์ฐ์ค๋ฝ๊ฒ ๋๋ด์ค. ํ์ํ๋ค๋ฉด ๊ธ์ด ๊ธธ์ด๋ ์ข์ผ๋ "
|
| 61 |
+
"์ค๊ฐ์ด ๋๊ธฐ์ง ์๋๋ก ์๋ฃ๋ ๋ฌธ์ฅ์ ์์ฑํด."
|
| 62 |
+
),
|
| 63 |
+
max_tokens=400,
|
| 64 |
+
temperature=0.7,
|
| 65 |
+
top_p=0.9,
|
| 66 |
+
)
|
| 67 |
+
return preview_difficulties, preview_goals
|
| 68 |
+
|
| 69 |
+
############################
|
| 70 |
+
# (2) ์ฌ๋ฌด ๋ถ์ ํจ์
|
| 71 |
############################
|
| 72 |
def analyze_financials(
|
| 73 |
+
avg_monthly_sales,
|
| 74 |
+
rent,
|
| 75 |
+
labor_cost,
|
| 76 |
+
management_cost,
|
| 77 |
+
utilities,
|
| 78 |
+
current_interest,
|
| 79 |
+
other_cost,
|
| 80 |
+
cost_ratio
|
| 81 |
):
|
| 82 |
"""
|
| 83 |
+
- GPT๋ฅผ ์ด์ฉํด ๊ฐ๊ฐ์๊ฐ๋น, ์์ด์ต์จ, ์์์์ต, ์์ต๋ถ๊ธฐ์ ๊ณ์ฐ
|
| 84 |
+
- ์ถ๋ ฅ: '์ ๋ชฉ: ์์น' ํํ (์ถ๊ฐ ์ค๋ช
์์ด)
|
| 85 |
"""
|
| 86 |
system_message = (
|
| 87 |
"๋น์ ์ ์ธ๋ฌด์ฌ(ํ๊ณ์ฌ)์
๋๋ค. ์๋ ์
๋ ฅ๊ฐ์ ๋ฐํ์ผ๋ก ๊ณ์ฐํ ๊ฐ๊ฐ์๊ฐ๋น, ์์ด์ต์จ, "
|
|
|
|
| 114 |
)
|
| 115 |
|
| 116 |
############################
|
| 117 |
+
# (3) SWOT ๋ถ์ ํจ์
|
| 118 |
############################
|
| 119 |
def analyze_swot(strengths, weaknesses, opportunities, threats):
|
| 120 |
"""
|
| 121 |
+
- ์
๋ ฅ๋ ๊ฐ์ , ์ฝ์ , ๊ธฐํ, ์ํ โ ์์ฝ
|
| 122 |
"""
|
| 123 |
system_message = "๋น์ ์ swot ๋ถ์ ์ ๋ฌธ๊ฐ์
๋๋ค. ์ฌ์ฉ์์ ๊ฐ์ , ์ฝ์ , ๊ธฐํ, ์ํ์ ๋ํด ๊ฒ์ํ ๋ด์ฉ์ ์์ฝํ์ฌ ์ ๊ณตํฉ๋๋ค."
|
| 124 |
content = f"""
|
|
|
|
| 136 |
)
|
| 137 |
|
| 138 |
############################
|
| 139 |
+
# (4) ์๊ถ ๋ถ์ ํจ์ (6์ค ์ด๋ด)
|
| 140 |
############################
|
| 141 |
def analyze_market(region, industry):
|
| 142 |
"""
|
| 143 |
+
- ์ง์ญ + ์
์ข
โ 1km ์ด๋ด ์๊ถ๋ถ์
|
| 144 |
+
- ์ฌ์ง(์๊ฐ์๋ฃ) ์ธ๊ธ + 6์ค ์ด๋ด
|
| 145 |
"""
|
| 146 |
system_message = (
|
| 147 |
"๋น์ ์ ์๊ถ๋ถ์ ์ ๋ฌธ๊ฐ์
๋๋ค. ์
๋ ฅ๋ ์ง์ญ๊ณผ ์
์ข
์ ๋ํด 1km ์ด๋ด ์๊ถ์ ๋ถ์ํด ์ฃผ์ธ์. "
|
|
|
|
| 160 |
)
|
| 161 |
|
| 162 |
############################
|
| 163 |
+
# (5) ์์
์์ฑ/๋ค์ด๋ก๋ ํจ์
|
| 164 |
+
# - ์๋จ 8๊ฐ ์ ๋ณด, D11/D22, ์ฌ์ง(B117/F117=5cm),
|
| 165 |
+
# (SWOT ๊ฒฐ๊ณผ๋ ๋ณ๋ export)
|
| 166 |
+
############################
|
| 167 |
+
def generate_excel(
|
| 168 |
+
# ์๋จ 8๊ฐ ์
๋ ฅ
|
| 169 |
+
consulting_company_rep,
|
| 170 |
+
consulting_address,
|
| 171 |
+
consulting_field,
|
| 172 |
+
client_name,
|
| 173 |
+
consulting_contact,
|
| 174 |
+
consulting_date_time,
|
| 175 |
+
consulting_round,
|
| 176 |
+
consulting_region,
|
| 177 |
+
|
| 178 |
+
# ์ฌ์ง
|
| 179 |
+
photo1,
|
| 180 |
+
photo2,
|
| 181 |
+
|
| 182 |
+
# ์ ๋ก์ฌํญ/๋ชฉํ ๋ถ์๊ฒฐ๊ณผ
|
| 183 |
+
preview_difficulties,
|
| 184 |
+
preview_goals
|
| 185 |
+
):
|
| 186 |
+
"""
|
| 187 |
+
- EXE.xlsx ํ
ํ๋ฆฟ ๋ถ๋ฌ์ค๊ธฐ
|
| 188 |
+
- ์๋จ 8๊ฐ ํญ๋ชฉ => C4:D4:E4, C5:D5:E5, ... G7:H7 (๋ณํฉ+๊ฐ์ด๋ฐ ์ ๋ ฌ)
|
| 189 |
+
- ์ ๋ก์ฌํญ D11, ์ปจ์คํ
๋ชฉํ D22
|
| 190 |
+
- ์ฌ์ง B117, F117 (๊ฐ๊ฐ 5cm)
|
| 191 |
+
"""
|
| 192 |
+
wb = load_workbook("EXE.xlsx")
|
| 193 |
+
ws = wb.active
|
| 194 |
+
|
| 195 |
+
# (1) ์๋จ 8๊ฐ ์ ๋ณด
|
| 196 |
+
# 1) ์
์ฒด๋ช
/๋ํ
|
| 197 |
+
ws.merge_cells("C4:E4")
|
| 198 |
+
ws["C4"] = consulting_company_rep
|
| 199 |
+
ws["C4"].alignment = Alignment(horizontal="center", vertical="center")
|
| 200 |
+
|
| 201 |
+
# 2) ์ฃผ์
|
| 202 |
+
ws.merge_cells("C5:E5")
|
| 203 |
+
ws["C5"] = consulting_address
|
| 204 |
+
ws["C5"].alignment = Alignment(horizontal="center", vertical="center")
|
| 205 |
+
|
| 206 |
+
# 3) ๋ถ์ผ
|
| 207 |
+
ws.merge_cells("C6:E6")
|
| 208 |
+
ws["C6"] = consulting_field
|
| 209 |
+
ws["C6"].alignment = Alignment(horizontal="center", vertical="center")
|
| 210 |
+
|
| 211 |
+
# 4) ์ฑ๋ช
|
| 212 |
+
ws.merge_cells("C7:E7")
|
| 213 |
+
ws["C7"] = client_name
|
| 214 |
+
ws["C7"].alignment = Alignment(horizontal="center", vertical="center")
|
| 215 |
+
|
| 216 |
+
# 5) ์ฐ๋ฝ์ฒ
|
| 217 |
+
ws.merge_cells("G4:H4")
|
| 218 |
+
ws["G4"] = consulting_contact
|
| 219 |
+
ws["G4"].alignment = Alignment(horizontal="center", vertical="center")
|
| 220 |
+
|
| 221 |
+
# 6) ์ํ์ผ์/์๊ฐ
|
| 222 |
+
ws.merge_cells("G5:H5")
|
| 223 |
+
ws["G5"] = consulting_date_time
|
| 224 |
+
ws["G5"].alignment = Alignment(horizontal="center", vertical="center")
|
| 225 |
+
|
| 226 |
+
# 7) ์งํ์ฐจ์
|
| 227 |
+
ws.merge_cells("G6:H6")
|
| 228 |
+
ws["G6"] = consulting_round
|
| 229 |
+
ws["G6"].alignment = Alignment(horizontal="center", vertical="center")
|
| 230 |
+
|
| 231 |
+
# 8) ์ง์ญ
|
| 232 |
+
ws.merge_cells("G7:H7")
|
| 233 |
+
ws["G7"] = consulting_region
|
| 234 |
+
ws["G7"].alignment = Alignment(horizontal="center", vertical="center")
|
| 235 |
+
|
| 236 |
+
# (2) ์ ๋ก์ฌํญ/๋ชฉํ
|
| 237 |
+
ws["D11"] = preview_difficulties
|
| 238 |
+
ws["D22"] = preview_goals
|
| 239 |
+
ws["D11"].alignment = Alignment(wrap_text=True)
|
| 240 |
+
ws["D22"].alignment = Alignment(wrap_text=True)
|
| 241 |
+
|
| 242 |
+
# (3) ์ฌ์ง (5cm ร 5cm)
|
| 243 |
+
width_px = int(37.79 * 5)
|
| 244 |
+
height_px = int(37.79 * 5)
|
| 245 |
+
|
| 246 |
+
if photo1 is not None:
|
| 247 |
+
img1_bytes = BytesIO()
|
| 248 |
+
photo1.save(img1_bytes, format="PNG")
|
| 249 |
+
img1_bytes.seek(0)
|
| 250 |
+
img1_for_excel = ExcelImage(img1_bytes)
|
| 251 |
+
img1_for_excel.width = width_px
|
| 252 |
+
img1_for_excel.height = height_px
|
| 253 |
+
ws.add_image(img1_for_excel, "B117")
|
| 254 |
+
|
| 255 |
+
if photo2 is not None:
|
| 256 |
+
img2_bytes = BytesIO()
|
| 257 |
+
photo2.save(img2_bytes, format="PNG")
|
| 258 |
+
img2_bytes.seek(0)
|
| 259 |
+
img2_for_excel = ExcelImage(img2_bytes)
|
| 260 |
+
img2_for_excel.width = width_px
|
| 261 |
+
img2_for_excel.height = height_px
|
| 262 |
+
ws.add_image(img2_for_excel, "F117")
|
| 263 |
+
|
| 264 |
+
# (4) ์ ์ฅ -> EXE.xlsx
|
| 265 |
+
output = BytesIO()
|
| 266 |
+
wb.save(output)
|
| 267 |
+
output.seek(0)
|
| 268 |
+
|
| 269 |
+
with tempfile.NamedTemporaryFile(delete=False, suffix=".xlsx") as tmp:
|
| 270 |
+
tmp.write(output.getvalue())
|
| 271 |
+
tmp.flush()
|
| 272 |
+
temp_file_path = tmp.name
|
| 273 |
+
|
| 274 |
+
final_path = os.path.join(os.path.dirname(temp_file_path), "EXE.xlsx")
|
| 275 |
+
os.rename(temp_file_path, final_path)
|
| 276 |
+
return final_path
|
| 277 |
+
|
| 278 |
+
############################
|
| 279 |
+
# (6) SWOT ๊ฒฐ๊ณผ๋ฅผ EXE.xlsx์ ๊ธฐ๋ก (๊ฐ์ /์ฝ์ /๊ธฐํ/์ํ)
|
| 280 |
############################
|
| 281 |
def export_swot_excel(strengths, weaknesses, opportunities, threats):
|
| 282 |
"""
|
| 283 |
+
- D45:E45:F45:G45:H45 = ๊ฐ์
|
| 284 |
+
- D54:E54:F54:G54:H54 = ์ฝ์
|
| 285 |
+
- D63:E63:F63:G63:H63 = ๊ธฐํ
|
| 286 |
+
- D72:E72:F72:G72:H72 = ์ํ
|
|
|
|
|
|
|
| 287 |
"""
|
| 288 |
wb = load_workbook("EXE.xlsx")
|
| 289 |
ws = wb.active
|
|
|
|
| 292 |
ws.merge_cells("D45:H45")
|
| 293 |
ws["D45"] = strengths
|
| 294 |
ws["D45"].alignment = Alignment(horizontal="center", vertical="center", wrap_text=True)
|
|
|
|
| 295 |
# ์ฝ์
|
| 296 |
ws.merge_cells("D54:H54")
|
| 297 |
ws["D54"] = weaknesses
|
| 298 |
ws["D54"].alignment = Alignment(horizontal="center", vertical="center", wrap_text=True)
|
|
|
|
| 299 |
# ๊ธฐํ
|
| 300 |
ws.merge_cells("D63:H63")
|
| 301 |
ws["D63"] = opportunities
|
| 302 |
ws["D63"].alignment = Alignment(horizontal="center", vertical="center", wrap_text=True)
|
|
|
|
| 303 |
# ์ํ
|
| 304 |
ws.merge_cells("D72:H72")
|
| 305 |
ws["D72"] = threats
|
| 306 |
ws["D72"].alignment = Alignment(horizontal="center", vertical="center", wrap_text=True)
|
| 307 |
|
| 308 |
+
# ์ ์ฅ -> EXE.xlsx
|
| 309 |
output = BytesIO()
|
| 310 |
wb.save(output)
|
| 311 |
output.seek(0)
|
|
|
|
| 312 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".xlsx") as tmp:
|
| 313 |
tmp.write(output.getvalue())
|
| 314 |
tmp.flush()
|
| 315 |
temp_file_path = tmp.name
|
|
|
|
| 316 |
final_path = os.path.join(os.path.dirname(temp_file_path), "EXE.xlsx")
|
| 317 |
os.rename(temp_file_path, final_path)
|
| 318 |
return final_path
|
| 319 |
|
| 320 |
+
############################
|
| 321 |
+
# Gradio ์ด๋ฒคํธ ํจ์
|
| 322 |
+
############################
|
| 323 |
+
def run_analyze(difficulties, goals):
|
| 324 |
+
return analyze_texts(difficulties, goals)
|
| 325 |
+
|
| 326 |
+
def run_generate_excel(
|
| 327 |
+
# ์๋จ 8๊ฐ ์
๋ ฅ
|
| 328 |
+
consulting_company_rep,
|
| 329 |
+
consulting_address,
|
| 330 |
+
consulting_field,
|
| 331 |
+
client_name,
|
| 332 |
+
consulting_contact,
|
| 333 |
+
consulting_date_time,
|
| 334 |
+
consulting_round,
|
| 335 |
+
consulting_region,
|
| 336 |
+
|
| 337 |
+
# ๊ธฐ์กด
|
| 338 |
+
photo1,
|
| 339 |
+
photo2,
|
| 340 |
+
difficulties,
|
| 341 |
+
goals,
|
| 342 |
+
preview_difficulties,
|
| 343 |
+
preview_goals
|
| 344 |
+
):
|
| 345 |
+
return generate_excel(
|
| 346 |
+
consulting_company_rep,
|
| 347 |
+
consulting_address,
|
| 348 |
+
consulting_field,
|
| 349 |
+
client_name,
|
| 350 |
+
consulting_contact,
|
| 351 |
+
consulting_date_time,
|
| 352 |
+
consulting_round,
|
| 353 |
+
consulting_region,
|
| 354 |
+
photo1,
|
| 355 |
+
photo2,
|
| 356 |
+
preview_difficulties,
|
| 357 |
+
preview_goals
|
| 358 |
+
)
|
| 359 |
+
|
| 360 |
def run_export_swot_excel(strengths, weaknesses, opportunities, threats):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 361 |
return export_swot_excel(strengths, weaknesses, opportunities, threats)
|
| 362 |
|
| 363 |
+
def run_analyze_financials(
|
| 364 |
+
avg_monthly_sales,
|
| 365 |
+
rent,
|
| 366 |
+
labor_cost,
|
| 367 |
+
management_cost,
|
| 368 |
+
utilities,
|
| 369 |
+
current_interest,
|
| 370 |
+
other_cost,
|
| 371 |
+
cost_ratio
|
| 372 |
+
):
|
| 373 |
+
return analyze_financials(
|
| 374 |
+
avg_monthly_sales,
|
| 375 |
+
rent,
|
| 376 |
+
labor_cost,
|
| 377 |
+
management_cost,
|
| 378 |
+
utilities,
|
| 379 |
+
current_interest,
|
| 380 |
+
other_cost,
|
| 381 |
+
cost_ratio
|
| 382 |
+
)
|
| 383 |
+
|
| 384 |
+
def run_analyze_market(region, industry):
|
| 385 |
+
return analyze_market(region, industry)
|
| 386 |
+
|
| 387 |
############################
|
| 388 |
# ๋จ์ผ ํ์ด์ง Gradio ์ฑ
|
| 389 |
############################
|
| 390 |
def main():
|
| 391 |
with gr.Blocks() as demo:
|
| 392 |
+
gr.Markdown("## (๋จ์ผ ํ์ด์ง) ์ฌ๋ฌด + SWOT + ์๊ถ + ์ปจ์คํ
/์ ๋ก์ฌํญ + ์์
์ถ๋ ฅ")
|
| 393 |
+
|
| 394 |
+
# -------------------------
|
| 395 |
+
# [1] ์๋จ 8๊ฐ ์
๋ ฅ
|
| 396 |
+
# -------------------------
|
| 397 |
+
gr.Markdown("### ์๋จ 8๊ฐ ์ ๋ณด (EXE.xlsx C4:E4.. G7:H7)")
|
| 398 |
+
with gr.Row():
|
| 399 |
+
consulting_company_rep = gr.Textbox(label="์ปจ์คํ
์
์ฒด๋ช
๋ฐ ๋ํ")
|
| 400 |
+
consulting_address = gr.Textbox(label="์ปจ์คํ
์ฃผ์")
|
| 401 |
+
consulting_field = gr.Textbox(label="์ปจ์คํ
๋ถ์ผ")
|
| 402 |
+
client_name = gr.Textbox(label="์ฑ๋ช
")
|
| 403 |
+
|
| 404 |
+
with gr.Row():
|
| 405 |
+
consulting_contact = gr.Textbox(label="์ปจ์คํ
์
์ฒด ์ฐ๋ฝ์ฒ")
|
| 406 |
+
consulting_date_time = gr.Textbox(label="์ปจ์คํ
์ํ์ผ์ ๋ฐ ์๊ฐ")
|
| 407 |
+
consulting_round = gr.Textbox(label="์งํ์ฐจ์")
|
| 408 |
+
consulting_region = gr.Textbox(label="์ง์ญ")
|
| 409 |
|
| 410 |
+
gr.Markdown("---")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 411 |
|
| 412 |
+
# -------------------------
|
| 413 |
+
# [2] ์ ๋ก์ฌํญ/๋ชฉํ ์
๋ ฅ -> GPT ๋ถ์
|
| 414 |
+
# -------------------------
|
| 415 |
+
gr.Markdown("### ์ ๋ก์ฌํญ & ์ปจ์คํ
๋ชฉํ (GPT-4o-mini ๋ถ์, D11/D22)")
|
| 416 |
|
| 417 |
+
with gr.Row():
|
| 418 |
+
difficulties_input = gr.Textbox(label="์ ๋ก์ฌํญ ์
๋ ฅ", lines=3)
|
| 419 |
+
goals_input = gr.Textbox(label="์ปจ์คํ
๋ชฉํ ์
๋ ฅ", lines=3)
|
| 420 |
+
|
| 421 |
+
analyze_button = gr.Button("๋ถ์ํ๊ธฐ")
|
| 422 |
+
preview_difficulties_output = gr.Textbox(label="์ ๋ก์ฌํญ ๋ถ์ ๊ฒฐ๊ณผ", lines=3)
|
| 423 |
+
preview_goals_output = gr.Textbox(label="์ปจ์คํ
๋ชฉํ ๋ถ์ ๊ฒฐ๊ณผ", lines=3)
|
| 424 |
+
|
| 425 |
+
analyze_button.click(
|
| 426 |
+
fn=run_analyze,
|
| 427 |
+
inputs=[difficulties_input, goals_input],
|
| 428 |
+
outputs=[preview_difficulties_output, preview_goals_output]
|
|
|
|
|
|
|
| 429 |
)
|
| 430 |
|
| 431 |
gr.Markdown("---")
|
| 432 |
|
| 433 |
+
# -------------------------
|
| 434 |
+
# [3] ์ฌ์ง 2๊ฐ
|
| 435 |
+
# -------------------------
|
| 436 |
+
gr.Markdown("### ์ฌ์ง ์
๋ก๋ (B117/F117, ํฌ๊ธฐ 5ร5cm)")
|
| 437 |
+
|
| 438 |
+
with gr.Row():
|
| 439 |
+
photo_input_1 = gr.Image(label="์์ง์
์ฒด์ฌ์ง1", type="pil")
|
| 440 |
+
photo_input_2 = gr.Image(label="์์ง์
์ฒด์ฌ์ง2", type="pil")
|
| 441 |
+
|
| 442 |
+
gr.Markdown("---")
|
| 443 |
+
|
| 444 |
+
# -------------------------
|
| 445 |
+
# [4] SWOT ๋ถ์
|
| 446 |
+
# -------------------------
|
| 447 |
+
gr.Markdown("### SWOT ๋ถ์ (๊ฐ์ /์ฝ์ /๊ธฐํ/์ํ)")
|
| 448 |
|
| 449 |
strengths_input = gr.Textbox(label="๊ฐ์ ")
|
| 450 |
weaknesses_input = gr.Textbox(label="์ฝ์ ")
|
| 451 |
opportunities_input = gr.Textbox(label="๊ธฐํ")
|
| 452 |
threats_input = gr.Textbox(label="์ํ")
|
| 453 |
|
|
|
|
| 454 |
analyze_button_swot = gr.Button("SWOT ๋ถ์ํ๊ธฐ")
|
| 455 |
+
result_output_swot = gr.Textbox(label="SWOT ๊ฒฐ๊ณผ")
|
| 456 |
|
|
|
|
| 457 |
analyze_button_swot.click(
|
| 458 |
fn=analyze_swot,
|
| 459 |
inputs=[strengths_input, weaknesses_input, opportunities_input, threats_input],
|
| 460 |
outputs=result_output_swot
|
| 461 |
)
|
| 462 |
|
| 463 |
+
# SWOT โ Excel
|
| 464 |
+
swot_excel_button = gr.Button("SWOT ๊ฒฐ๊ณผ๋ฅผ EXE.xlsx๋ก ๋ค์ด๋ก๋")
|
| 465 |
+
swot_excel_file = gr.File(label="๋ค์ด๋ก๋(ํด๋ฆญ ํ ์ ์ฅ)")
|
| 466 |
|
| 467 |
+
swot_excel_button.click(
|
|
|
|
| 468 |
fn=run_export_swot_excel,
|
| 469 |
inputs=[strengths_input, weaknesses_input, opportunities_input, threats_input],
|
| 470 |
+
outputs=[swot_excel_file]
|
| 471 |
)
|
| 472 |
|
| 473 |
gr.Markdown("---")
|
| 474 |
|
| 475 |
+
# -------------------------
|
| 476 |
+
# [5] ์ฌ๋ฌด ๋ถ์
|
| 477 |
+
# -------------------------
|
| 478 |
+
gr.Markdown("### ์ฌ๋ฌด ๋ถ์ (์ํ๊ท ๋งค์ถ์ก ๋ฑ 8๊ฐ ์
๋ ฅ)")
|
| 479 |
+
|
| 480 |
+
avg_monthly_sales_input = gr.Textbox(label="์ํ๊ท ๋งค์ถ์ก")
|
| 481 |
+
rent_input = gr.Textbox(label="์์ฐจ๋ฃ")
|
| 482 |
+
labor_cost_input = gr.Textbox(label="์ธ๊ฑด๋น")
|
| 483 |
+
management_cost_input = gr.Textbox(label="๊ด๋ฆฌ๋น")
|
| 484 |
+
utilities_input = gr.Textbox(label="์๋๊ด์ด๋น")
|
| 485 |
+
current_interest_input = gr.Textbox(label="์ง๊ธ์ด์")
|
| 486 |
+
other_cost_input = gr.Textbox(label="๊ธฐํ๋น์ฉ")
|
| 487 |
+
cost_ratio_input = gr.Textbox(label="์๊ฐ์จ")
|
| 488 |
+
|
| 489 |
+
result_output_fin = gr.Textbox(label="์ฌ๋ฌด๋ถ์ ๊ฒฐ๊ณผ(์ ๋ชฉ: ์์น)")
|
| 490 |
+
analyze_button_fin = gr.Button("์ฌ๋ฌด๋ถ์ ๊ณ์ฐํ๊ธฐ")
|
| 491 |
+
|
| 492 |
+
analyze_button_fin.click(
|
| 493 |
+
fn=run_analyze_financials,
|
| 494 |
+
inputs=[
|
| 495 |
+
avg_monthly_sales_input,
|
| 496 |
+
rent_input,
|
| 497 |
+
labor_cost_input,
|
| 498 |
+
management_cost_input,
|
| 499 |
+
utilities_input,
|
| 500 |
+
current_interest_input,
|
| 501 |
+
other_cost_input,
|
| 502 |
+
cost_ratio_input
|
| 503 |
+
],
|
| 504 |
+
outputs=result_output_fin
|
| 505 |
+
)
|
| 506 |
+
|
| 507 |
+
gr.Markdown("---")
|
| 508 |
+
|
| 509 |
+
# -------------------------
|
| 510 |
+
# [6] ์๊ถ ๋ถ์
|
| 511 |
+
# -------------------------
|
| 512 |
+
gr.Markdown("### ์๊ถ ๋ถ์ (์ง์ญ+์
์ข
โ 6์ค ์ด๋ด, ์ฌ์ง ์ธ๊ธ)")
|
| 513 |
|
| 514 |
region_input = gr.Textbox(label="์ง์ญ")
|
| 515 |
industry_input = gr.Textbox(label="์
์ข
")
|
|
|
|
| 516 |
result_output_market = gr.Textbox(label="์๊ถ๋ถ์ ๊ฒฐ๊ณผ (์ต๋ 6์ค)")
|
| 517 |
+
analyze_button_market = gr.Button("์๊ถ๋ถ์")
|
| 518 |
|
|
|
|
| 519 |
analyze_button_market.click(
|
| 520 |
+
fn=run_analyze_market,
|
| 521 |
inputs=[region_input, industry_input],
|
| 522 |
outputs=result_output_market
|
| 523 |
)
|
| 524 |
|
| 525 |
+
gr.Markdown("---")
|
| 526 |
+
|
| 527 |
+
# -------------------------
|
| 528 |
+
# [7] Excel๋ก ์ต์ข
๋ค์ด๋ก๋
|
| 529 |
+
# -------------------------
|
| 530 |
+
gr.Markdown("### (์๋จ 8๊ฐ ์ ๋ณด + ์ ๋ก์ฌํญ/๋ชฉํ + ์ฌ์ง) โ EXE.xlsx")
|
| 531 |
+
download_button = gr.Button("์ต์ข
EXE.xlsx ๋ค์ด๋ก๋")
|
| 532 |
+
download_file = gr.File(label="๋ค์ด๋ก๋(ํด๋ฆญ ํ ์ ์ฅ)")
|
| 533 |
+
|
| 534 |
+
download_button.click(
|
| 535 |
+
fn=run_generate_excel,
|
| 536 |
+
inputs=[
|
| 537 |
+
# 8๊ฐ ์
๋ ฅ
|
| 538 |
+
consulting_company_rep,
|
| 539 |
+
consulting_address,
|
| 540 |
+
consulting_field,
|
| 541 |
+
client_name,
|
| 542 |
+
consulting_contact,
|
| 543 |
+
consulting_date_time,
|
| 544 |
+
consulting_round,
|
| 545 |
+
consulting_region,
|
| 546 |
+
|
| 547 |
+
# ์ฌ์ง
|
| 548 |
+
photo_input_1,
|
| 549 |
+
photo_input_2,
|
| 550 |
+
|
| 551 |
+
# ์ ๋ก์ฌํญ/๋ชฉํ ์๋ฌธ + ๋ถ์๊ฒฐ๊ณผ
|
| 552 |
+
difficulties_input,
|
| 553 |
+
goals_input,
|
| 554 |
+
preview_difficulties_output,
|
| 555 |
+
preview_goals_output
|
| 556 |
+
],
|
| 557 |
+
outputs=[download_file]
|
| 558 |
+
)
|
| 559 |
+
|
| 560 |
demo.launch()
|
| 561 |
|
| 562 |
if __name__ == "__main__":
|