Update app.py
Browse files
app.py
CHANGED
|
@@ -17,7 +17,7 @@ openai.api_key = os.getenv("OPENAI_API_KEY")
|
|
| 17 |
######################
|
| 18 |
def call_api(content, system_message, max_tokens, temperature, top_p):
|
| 19 |
response = openai.ChatCompletion.create(
|
| 20 |
-
model="gpt-4o-mini",
|
| 21 |
messages=[
|
| 22 |
{"role": "system", "content": system_message},
|
| 23 |
{"role": "user", "content": content},
|
|
@@ -28,31 +28,15 @@ def call_api(content, system_message, max_tokens, temperature, top_p):
|
|
| 28 |
)
|
| 29 |
return response.choices[0].message["content"]
|
| 30 |
|
| 31 |
-
############################
|
| 32 |
-
# ๋ณํฉ ๋ฒ์ ๊ฐ์ ํด์ ํจ์
|
| 33 |
-
############################
|
| 34 |
-
def unmerge_conflicting_cells(ws, cell_coords):
|
| 35 |
-
"""
|
| 36 |
-
cell_coords ๋ฆฌ์คํธ ๋ด์ ์๋ ๊ฐ ์ขํ(์: 'C4')๊ฐ
|
| 37 |
-
์ด๋ค ๋ณํฉ ๋ฒ์(merged_range)์ ํฌํจ๋์ด ์์ผ๋ฉด,
|
| 38 |
-
ํด๋น ๋ฒ์๋ฅผ ์ ๋ถ unmerge ํด๋ฒ๋ฆฐ๋ค.
|
| 39 |
-
"""
|
| 40 |
-
# ๋ณํฉ ๋ฒ์๋ฅผ ์ํํ๋ฉด์ ํด์ ํด์ผ ํ๋ฏ๋ก,
|
| 41 |
-
# ๋ณํฉ ๋ชฉ๋ก์ list(...)๋ก ๋ณต์ฌ ํ ์์ ํด์ผ ํจ
|
| 42 |
-
merged_ranges = list(ws.merged_cells.ranges)
|
| 43 |
-
|
| 44 |
-
for rng in merged_ranges:
|
| 45 |
-
# ์: rng.coord == 'C4:D42'
|
| 46 |
-
for c in cell_coords:
|
| 47 |
-
if c in rng.coord:
|
| 48 |
-
ws.unmerge_cells(str(rng.coord)) # ๊ฐ์ ํด์
|
| 49 |
-
break # ํ๋ฒ unmerge ํ๋ฉด ํด๋น rng๋ ๊นจ์ก์ผ๋ฏ๋ก break
|
| 50 |
-
|
| 51 |
######################
|
| 52 |
# ๋ถ์ ํจ์
|
| 53 |
######################
|
| 54 |
def analyze_texts(difficulties, goals):
|
| 55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
preview_difficulties = call_api(
|
| 57 |
content=difficulties,
|
| 58 |
system_message="์ฌ์ฉ์๊ฐ ์
๋ ฅํ ์ ๋ก์ฌํญ์ ๊ฐ๋จํ ๋ถ์ํด์ค.",
|
|
@@ -60,7 +44,7 @@ def analyze_texts(difficulties, goals):
|
|
| 60 |
temperature=0.7,
|
| 61 |
top_p=0.9,
|
| 62 |
)
|
| 63 |
-
# ์ปจ์คํ
๋ชฉํ
|
| 64 |
preview_goals = call_api(
|
| 65 |
content=goals,
|
| 66 |
system_message="์ฌ์ฉ์๊ฐ ์
๋ ฅํ ์ปจ์คํ
๋ชฉํ๋ฅผ ๊ฐ๋จํ ์์ฝํด์ค.",
|
|
@@ -74,62 +58,54 @@ def analyze_texts(difficulties, goals):
|
|
| 74 |
# ์์
์์ฑ(๋ค์ด๋ก๋) ํจ์
|
| 75 |
######################
|
| 76 |
def generate_excel(
|
| 77 |
-
# 8๊ฐ ์
๋ ฅ
|
| 78 |
-
consultant_name_rep,
|
| 79 |
-
consultant_contact,
|
| 80 |
-
consultant_address,
|
| 81 |
-
consultant_time,
|
| 82 |
-
consultant_field,
|
| 83 |
-
consultant_round,
|
| 84 |
-
consultant_client_name,
|
| 85 |
-
consultant_region,
|
| 86 |
|
| 87 |
# ์ฌ์ง 2๊ฐ
|
| 88 |
photo1,
|
| 89 |
photo2,
|
| 90 |
|
| 91 |
-
# ๋ถ์
|
| 92 |
preview_difficulties,
|
| 93 |
preview_goals
|
| 94 |
):
|
| 95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
ws = wb.active
|
| 97 |
|
| 98 |
-
#
|
| 99 |
-
|
| 100 |
-
############################
|
| 101 |
-
# C4,G4,C5,G5,C6,G6,C7,G7 ์ D11,D22
|
| 102 |
-
# -> ์ด ์ค ํ๋๋ผ๋ ๋ณํฉ ๋ฒ์์ ํฌํจ๋์ด ์๋ค๋ฉด
|
| 103 |
-
# ์ ๋ถ unmerge ํด๋ฒ๋ฆผ
|
| 104 |
-
targets = ["C4","G4","C5","G5","C6","G6","C7","G7","D11","D22"]
|
| 105 |
-
unmerge_conflicting_cells(ws, targets)
|
| 106 |
-
|
| 107 |
-
############################
|
| 108 |
-
# 2) ์/์๋ ์ ๋ณด ๊ธฐ์
|
| 109 |
-
############################
|
| 110 |
-
# (1) ์๋จ ์ ๋ณด (C4, G4, C5, G5, C6, G6, C7, G7)
|
| 111 |
-
ws["C4"] = consultant_name_rep
|
| 112 |
ws["G4"] = consultant_contact
|
| 113 |
-
ws["
|
| 114 |
ws["G5"] = consultant_time
|
| 115 |
-
ws["
|
| 116 |
ws["G6"] = consultant_round
|
| 117 |
-
ws["
|
| 118 |
ws["G7"] = consultant_region
|
| 119 |
|
| 120 |
-
# (2) ์ ๋ก์ฌํญ/
|
| 121 |
ws["D11"] = preview_difficulties
|
| 122 |
ws["D22"] = preview_goals
|
| 123 |
|
| 124 |
-
# wrap_text
|
| 125 |
ws["D11"].alignment = Alignment(wrap_text=True)
|
| 126 |
ws["D22"].alignment = Alignment(wrap_text=True)
|
| 127 |
-
ws.column_dimensions["D"].width = 42 # ๋๋ต 10cm
|
| 128 |
|
| 129 |
-
#
|
| 130 |
-
# 3) ์ฌ์ง ์ฝ์
(B117, F117)
|
| 131 |
-
# (๊ฐ๋ก 8cm, ์ธ๋ก 5cm)
|
| 132 |
-
############################
|
| 133 |
width_px = int(37.79 * 8) # 8cm
|
| 134 |
height_px = int(37.79 * 5) # 5cm
|
| 135 |
|
|
@@ -151,9 +127,7 @@ def generate_excel(
|
|
| 151 |
img2_for_excel.height = height_px
|
| 152 |
ws.add_image(img2_for_excel, "F117")
|
| 153 |
|
| 154 |
-
#
|
| 155 |
-
# 4) ์์ ํ์ผ -> EXE.xlsx
|
| 156 |
-
############################
|
| 157 |
output = BytesIO()
|
| 158 |
wb.save(output)
|
| 159 |
output.seek(0)
|
|
@@ -173,10 +147,15 @@ def generate_excel(
|
|
| 173 |
# Gradio ์ด๋ฒคํธ ํจ์
|
| 174 |
######################
|
| 175 |
def run_analyze(difficulties, goals):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
preview_difficulties, preview_goals = analyze_texts(difficulties, goals)
|
| 177 |
return preview_difficulties, preview_goals
|
| 178 |
|
| 179 |
def run_generate_excel(
|
|
|
|
| 180 |
consultant_name_rep,
|
| 181 |
consultant_contact,
|
| 182 |
consultant_address,
|
|
@@ -186,14 +165,20 @@ def run_generate_excel(
|
|
| 186 |
consultant_client_name,
|
| 187 |
consultant_region,
|
| 188 |
|
|
|
|
| 189 |
photo1,
|
| 190 |
photo2,
|
| 191 |
|
|
|
|
| 192 |
difficulties,
|
| 193 |
goals,
|
| 194 |
preview_difficulties,
|
| 195 |
preview_goals
|
| 196 |
):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 197 |
excel_path = generate_excel(
|
| 198 |
consultant_name_rep,
|
| 199 |
consultant_contact,
|
|
@@ -217,15 +202,17 @@ def run_generate_excel(
|
|
| 217 |
######################
|
| 218 |
def create_app():
|
| 219 |
with gr.Blocks() as demo:
|
| 220 |
-
gr.Markdown("##
|
| 221 |
|
| 222 |
with gr.Row():
|
|
|
|
| 223 |
consultant_name_rep = gr.Textbox(label="์ปจ์คํ
์
์ฒด ๋ฐ ๋ํ ์ด๋ฆ")
|
| 224 |
consultant_contact = gr.Textbox(label="์ปจ์คํ
์
์ฒด ์ฐ๋ฝ์ฒ")
|
| 225 |
consultant_address = gr.Textbox(label="์ปจ์คํ
์ฃผ์")
|
| 226 |
consultant_time = gr.Textbox(label="์ปจ์คํ
์๊ฐ")
|
| 227 |
|
| 228 |
with gr.Row():
|
|
|
|
| 229 |
consultant_field = gr.Textbox(label="์ปจ์คํ
๋ถ์ผ")
|
| 230 |
consultant_round = gr.Textbox(label="์งํ์ฐจ์")
|
| 231 |
consultant_client_name = gr.Textbox(label="์ฑ๋ช
")
|
|
@@ -233,33 +220,38 @@ def create_app():
|
|
| 233 |
|
| 234 |
gr.Markdown("---")
|
| 235 |
|
|
|
|
| 236 |
with gr.Row():
|
| 237 |
difficulties_input = gr.Textbox(label="์ ๋ก์ฌํญ ์
๋ ฅ", lines=3)
|
| 238 |
goals_input = gr.Textbox(label="์ปจ์คํ
๋ชฉํ ์
๋ ฅ", lines=3)
|
| 239 |
|
| 240 |
gr.Markdown("---")
|
| 241 |
|
|
|
|
| 242 |
with gr.Row():
|
| 243 |
photo_input_1 = gr.Image(label="์์ง์
์ฒด์ฌ์ง", type="pil")
|
| 244 |
photo_input_2 = gr.Image(label="์์ง์
์ฒด์ฌ์ง", type="pil")
|
| 245 |
|
|
|
|
| 246 |
analyze_button = gr.Button("๋ถ์ํ๊ธฐ")
|
| 247 |
-
|
| 248 |
preview_difficulties_output = gr.Textbox(label="์ ๋ก์ฌํญ ๋ถ์ ๊ฒฐ๊ณผ ๋ฏธ๋ฆฌ๋ณด๊ธฐ", lines=3)
|
| 249 |
preview_goals_output = gr.Textbox(label="์ปจ์คํ
๋ชฉํ ๋ถ์ ๊ฒฐ๊ณผ ๋ฏธ๋ฆฌ๋ณด๊ธฐ", lines=3)
|
| 250 |
|
| 251 |
download_button = gr.Button("์์
๋ก ๋ค์ด๋ก๋")
|
| 252 |
download_file = gr.File(label="๋ค์ด๋ก๋(ํด๋ฆญ ํ ์ ์ฅ)")
|
| 253 |
|
|
|
|
| 254 |
analyze_button.click(
|
| 255 |
fn=run_analyze,
|
| 256 |
inputs=[difficulties_input, goals_input],
|
| 257 |
outputs=[preview_difficulties_output, preview_goals_output]
|
| 258 |
)
|
| 259 |
|
|
|
|
| 260 |
download_button.click(
|
| 261 |
fn=run_generate_excel,
|
| 262 |
inputs=[
|
|
|
|
| 263 |
consultant_name_rep,
|
| 264 |
consultant_contact,
|
| 265 |
consultant_address,
|
|
@@ -269,13 +261,15 @@ def create_app():
|
|
| 269 |
consultant_client_name,
|
| 270 |
consultant_region,
|
| 271 |
|
|
|
|
| 272 |
photo_input_1,
|
| 273 |
photo_input_2,
|
| 274 |
|
|
|
|
| 275 |
difficulties_input,
|
| 276 |
goals_input,
|
| 277 |
preview_difficulties_output,
|
| 278 |
-
preview_goals_output
|
| 279 |
],
|
| 280 |
outputs=[download_file]
|
| 281 |
)
|
|
|
|
| 17 |
######################
|
| 18 |
def call_api(content, system_message, max_tokens, temperature, top_p):
|
| 19 |
response = openai.ChatCompletion.create(
|
| 20 |
+
model="gpt-4o-mini", # ์์ฒญ์ฌํญ๋๋ก gpt-4o-mini ์ฌ์ฉ
|
| 21 |
messages=[
|
| 22 |
{"role": "system", "content": system_message},
|
| 23 |
{"role": "user", "content": content},
|
|
|
|
| 28 |
)
|
| 29 |
return response.choices[0].message["content"]
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
######################
|
| 32 |
# ๋ถ์ ํจ์
|
| 33 |
######################
|
| 34 |
def analyze_texts(difficulties, goals):
|
| 35 |
+
"""
|
| 36 |
+
์ฌ์ฉ์ ์
๋ ฅ(์ ๋ก์ฌํญ, ์ปจ์คํ
๋ชฉํ)์ gpt-4o-mini๋ก ๋ถ์ ํ
|
| 37 |
+
๋ฏธ๋ฆฌ๋ณด๊ธฐ(๊ฐ๋จ ์์ฝ)๋ฅผ ๋ฆฌํด
|
| 38 |
+
"""
|
| 39 |
+
# ์ ๋ก์ฌํญ ๋ถ์
|
| 40 |
preview_difficulties = call_api(
|
| 41 |
content=difficulties,
|
| 42 |
system_message="์ฌ์ฉ์๊ฐ ์
๋ ฅํ ์ ๋ก์ฌํญ์ ๊ฐ๋จํ ๋ถ์ํด์ค.",
|
|
|
|
| 44 |
temperature=0.7,
|
| 45 |
top_p=0.9,
|
| 46 |
)
|
| 47 |
+
# ์ปจ์คํ
๋ชฉํ ๋ถ์
|
| 48 |
preview_goals = call_api(
|
| 49 |
content=goals,
|
| 50 |
system_message="์ฌ์ฉ์๊ฐ ์
๋ ฅํ ์ปจ์คํ
๋ชฉํ๋ฅผ ๊ฐ๋จํ ์์ฝํด์ค.",
|
|
|
|
| 58 |
# ์์
์์ฑ(๋ค์ด๋ก๋) ํจ์
|
| 59 |
######################
|
| 60 |
def generate_excel(
|
| 61 |
+
# 8๊ฐ ์
๋ ฅ๊ฐ
|
| 62 |
+
consultant_name_rep, # ์ปจ์คํ
์
์ฒด ๋ฐ ๋ํ ์ด๋ฆ
|
| 63 |
+
consultant_contact, # ์ปจ์คํ
์
์ฒด ์ฐ๋ฝ์ฒ
|
| 64 |
+
consultant_address, # ์ปจ์คํ
์ฃผ์
|
| 65 |
+
consultant_time, # ์ปจ์คํ
์๊ฐ
|
| 66 |
+
consultant_field, # ์ปจ์คํ
๋ถ์ผ
|
| 67 |
+
consultant_round, # ์งํ์ฐจ์
|
| 68 |
+
consultant_client_name, # ์ฑ๋ช
|
| 69 |
+
consultant_region, # ์ง์ญ
|
| 70 |
|
| 71 |
# ์ฌ์ง 2๊ฐ
|
| 72 |
photo1,
|
| 73 |
photo2,
|
| 74 |
|
| 75 |
+
# ์ ๋ก์ฌํญ/๋ชฉํ ๋ถ์ ๊ฒฐ๊ณผ
|
| 76 |
preview_difficulties,
|
| 77 |
preview_goals
|
| 78 |
):
|
| 79 |
+
"""
|
| 80 |
+
1) EXE.xlsx ํ
ํ๋ฆฟ ๋ถ๋ฌ์ค๊ธฐ
|
| 81 |
+
2) 8๊ฐ ์
๋ ฅ๊ฐ -> D4,G4,D5,G5,D6,G6,D7,G7
|
| 82 |
+
3) D11 = ์ ๋ก์ฌํญ, D22 = ์ปจ์คํ
๋ชฉํ (wrap_text, ํญ=์ฝ 10cm)
|
| 83 |
+
4) B117, F117 -> ์ฌ์ง(8cmร5cm)
|
| 84 |
+
5) ๊ฒฐ๊ณผ๋ฅผ EXE.xlsx๋ก ์ ์ฅ ํ ๊ฒฝ๋ก ๋ฆฌํด
|
| 85 |
+
"""
|
| 86 |
+
wb = load_workbook("EXE.xlsx") # ํ
ํ๋ฆฟ ๊ทธ๋๋ก ์ฌ์ฉ (๋ณํฉ ํด์ ์ ํจ)
|
| 87 |
ws = wb.active
|
| 88 |
|
| 89 |
+
# (1) ์๋จ 8๊ฐ ์ ๋ณด
|
| 90 |
+
ws["D4"] = consultant_name_rep
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
ws["G4"] = consultant_contact
|
| 92 |
+
ws["D5"] = consultant_address
|
| 93 |
ws["G5"] = consultant_time
|
| 94 |
+
ws["D6"] = consultant_field
|
| 95 |
ws["G6"] = consultant_round
|
| 96 |
+
ws["D7"] = consultant_client_name
|
| 97 |
ws["G7"] = consultant_region
|
| 98 |
|
| 99 |
+
# (2) ์ ๋ก์ฌํญ / ์ปจ์คํ
๋ชฉํ
|
| 100 |
ws["D11"] = preview_difficulties
|
| 101 |
ws["D22"] = preview_goals
|
| 102 |
|
| 103 |
+
# wrap_text & ์ปฌ๋ผ ํญ ์ค์
|
| 104 |
ws["D11"].alignment = Alignment(wrap_text=True)
|
| 105 |
ws["D22"].alignment = Alignment(wrap_text=True)
|
| 106 |
+
ws.column_dimensions["D"].width = 42 # ๋๋ต 10cm ๊ทผ์ฌ
|
| 107 |
|
| 108 |
+
# (3) ์ฌ์ง 2๊ฐ ์ฝ์
: B117 / F117
|
|
|
|
|
|
|
|
|
|
| 109 |
width_px = int(37.79 * 8) # 8cm
|
| 110 |
height_px = int(37.79 * 5) # 5cm
|
| 111 |
|
|
|
|
| 127 |
img2_for_excel.height = height_px
|
| 128 |
ws.add_image(img2_for_excel, "F117")
|
| 129 |
|
| 130 |
+
# (4) ์์ํ์ผ -> EXE.xlsx
|
|
|
|
|
|
|
| 131 |
output = BytesIO()
|
| 132 |
wb.save(output)
|
| 133 |
output.seek(0)
|
|
|
|
| 147 |
# Gradio ์ด๋ฒคํธ ํจ์
|
| 148 |
######################
|
| 149 |
def run_analyze(difficulties, goals):
|
| 150 |
+
"""
|
| 151 |
+
'๋ถ์ํ๊ธฐ' ๋ฒํผ ํด๋ฆญ ์:
|
| 152 |
+
gpt-4o-mini๋ก ๊ฐ๋จ ๋ถ์ -> ๋ฏธ๋ฆฌ๋ณด๊ธฐ
|
| 153 |
+
"""
|
| 154 |
preview_difficulties, preview_goals = analyze_texts(difficulties, goals)
|
| 155 |
return preview_difficulties, preview_goals
|
| 156 |
|
| 157 |
def run_generate_excel(
|
| 158 |
+
# 8๊ฐ ์
๋ ฅ
|
| 159 |
consultant_name_rep,
|
| 160 |
consultant_contact,
|
| 161 |
consultant_address,
|
|
|
|
| 165 |
consultant_client_name,
|
| 166 |
consultant_region,
|
| 167 |
|
| 168 |
+
# ์ฌ์ง 2๊ฐ
|
| 169 |
photo1,
|
| 170 |
photo2,
|
| 171 |
|
| 172 |
+
# ์ ๋ก์ฌํญ/๋ชฉํ ์๋ฌธ + ๋ถ์๊ฒฐ๊ณผ
|
| 173 |
difficulties,
|
| 174 |
goals,
|
| 175 |
preview_difficulties,
|
| 176 |
preview_goals
|
| 177 |
):
|
| 178 |
+
"""
|
| 179 |
+
'์์
๋ก ๋ค์ด๋ก๋' ๋ฒํผ ํด๋ฆญ ์:
|
| 180 |
+
์ ์
๋ ฅ๋ค์ EXE.xlsx์ ๋ฐ์ -> ๋ค์ด๋ก๋
|
| 181 |
+
"""
|
| 182 |
excel_path = generate_excel(
|
| 183 |
consultant_name_rep,
|
| 184 |
consultant_contact,
|
|
|
|
| 202 |
######################
|
| 203 |
def create_app():
|
| 204 |
with gr.Blocks() as demo:
|
| 205 |
+
gr.Markdown("## (1) ์๋จ ์ ๋ณด 8๊ฐ ์
๋ ฅ + (2) ์ ๋ก์ฌํญ ๋ฐ ์ปจ์คํ
๋ชฉํ ์
๋ ฅ + (3) ์ฌ์ง ์
๋ก๋ -> Excel ๋ค์ด๋ก๋")
|
| 206 |
|
| 207 |
with gr.Row():
|
| 208 |
+
# ์ฒซ์งธ ์ค 4๊ฐ
|
| 209 |
consultant_name_rep = gr.Textbox(label="์ปจ์คํ
์
์ฒด ๋ฐ ๋ํ ์ด๋ฆ")
|
| 210 |
consultant_contact = gr.Textbox(label="์ปจ์คํ
์
์ฒด ์ฐ๋ฝ์ฒ")
|
| 211 |
consultant_address = gr.Textbox(label="์ปจ์คํ
์ฃผ์")
|
| 212 |
consultant_time = gr.Textbox(label="์ปจ์คํ
์๊ฐ")
|
| 213 |
|
| 214 |
with gr.Row():
|
| 215 |
+
# ๋์งธ ์ค 4๊ฐ
|
| 216 |
consultant_field = gr.Textbox(label="์ปจ์คํ
๋ถ์ผ")
|
| 217 |
consultant_round = gr.Textbox(label="์งํ์ฐจ์")
|
| 218 |
consultant_client_name = gr.Textbox(label="์ฑ๋ช
")
|
|
|
|
| 220 |
|
| 221 |
gr.Markdown("---")
|
| 222 |
|
| 223 |
+
# ์ ๋ก์ฌํญ / ์ปจ์คํ
๋ชฉํ ์
๋ ฅ
|
| 224 |
with gr.Row():
|
| 225 |
difficulties_input = gr.Textbox(label="์ ๋ก์ฌํญ ์
๋ ฅ", lines=3)
|
| 226 |
goals_input = gr.Textbox(label="์ปจ์คํ
๋ชฉํ ์
๋ ฅ", lines=3)
|
| 227 |
|
| 228 |
gr.Markdown("---")
|
| 229 |
|
| 230 |
+
# ์ฌ์ง 2๊ฐ ์
๋ก๋ (๋ ๋ค '์์ง์
์ฒด์ฌ์ง')
|
| 231 |
with gr.Row():
|
| 232 |
photo_input_1 = gr.Image(label="์์ง์
์ฒด์ฌ์ง", type="pil")
|
| 233 |
photo_input_2 = gr.Image(label="์์ง์
์ฒด์ฌ์ง", type="pil")
|
| 234 |
|
| 235 |
+
# ๋ฒํผ๋ค
|
| 236 |
analyze_button = gr.Button("๋ถ์ํ๊ธฐ")
|
|
|
|
| 237 |
preview_difficulties_output = gr.Textbox(label="์ ๋ก์ฌํญ ๋ถ์ ๊ฒฐ๊ณผ ๋ฏธ๋ฆฌ๋ณด๊ธฐ", lines=3)
|
| 238 |
preview_goals_output = gr.Textbox(label="์ปจ์คํ
๋ชฉํ ๋ถ์ ๊ฒฐ๊ณผ ๋ฏธ๋ฆฌ๋ณด๊ธฐ", lines=3)
|
| 239 |
|
| 240 |
download_button = gr.Button("์์
๋ก ๋ค์ด๋ก๋")
|
| 241 |
download_file = gr.File(label="๋ค์ด๋ก๋(ํด๋ฆญ ํ ์ ์ฅ)")
|
| 242 |
|
| 243 |
+
# [๋ถ์ํ๊ธฐ] -> GPT-4o-mini API๋ก ์์ฝ
|
| 244 |
analyze_button.click(
|
| 245 |
fn=run_analyze,
|
| 246 |
inputs=[difficulties_input, goals_input],
|
| 247 |
outputs=[preview_difficulties_output, preview_goals_output]
|
| 248 |
)
|
| 249 |
|
| 250 |
+
# [์์
๋ก ๋ค์ด๋ก๋] -> EXE.xlsx ์์ฑ
|
| 251 |
download_button.click(
|
| 252 |
fn=run_generate_excel,
|
| 253 |
inputs=[
|
| 254 |
+
# 8๊ฐ ์
๋ ฅ
|
| 255 |
consultant_name_rep,
|
| 256 |
consultant_contact,
|
| 257 |
consultant_address,
|
|
|
|
| 261 |
consultant_client_name,
|
| 262 |
consultant_region,
|
| 263 |
|
| 264 |
+
# ์ฌ์ง
|
| 265 |
photo_input_1,
|
| 266 |
photo_input_2,
|
| 267 |
|
| 268 |
+
# ์ ๋ก์ฌํญ/๋ชฉํ ์๋ฌธ + ๋ถ์๊ฒฐ๊ณผ
|
| 269 |
difficulties_input,
|
| 270 |
goals_input,
|
| 271 |
preview_difficulties_output,
|
| 272 |
+
preview_goals_output,
|
| 273 |
],
|
| 274 |
outputs=[download_file]
|
| 275 |
)
|