ginipick commited on
Commit
c4ad03b
ยท
verified ยท
1 Parent(s): ebc7917

Update app-backup1.py

Browse files
Files changed (1) hide show
  1. app-backup1.py +245 -150
app-backup1.py CHANGED
@@ -172,160 +172,255 @@ async def try_openai_api(openai_messages):
172
  print(f"OpenAI API error: {str(e)}")
173
  raise e
174
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  class Demo:
176
  def __init__(self):
177
  pass
178
-
179
  async def generation_code(self, query: Optional[str], _setting: Dict[str, str], _history: Optional[History]):
180
- if not query or query.strip() == '':
181
- query = random.choice(DEMO_LIST)['description']
182
-
183
- if _history is None:
184
- _history = []
185
-
186
- messages = history_to_messages(_history, _setting['system'])
187
- system_message = messages[0]['content']
188
-
189
- claude_messages = [
190
- {"role": msg["role"] if msg["role"] != "system" else "user", "content": msg["content"]}
191
- for msg in messages[1:] + [{'role': Role.USER, 'content': query}]
192
- if msg["content"].strip() != ''
193
- ]
194
-
195
- openai_messages = [{"role": "system", "content": system_message}]
196
- for msg in messages[1:]:
197
- openai_messages.append({
198
- "role": msg["role"],
199
- "content": msg["content"]
200
- })
201
- openai_messages.append({"role": "user", "content": query})
202
-
203
- try:
204
- yield [
205
- "Generating code...",
206
- _history,
207
- None,
208
- gr.update(active_key="loading"),
209
- gr.update(open=True)
210
- ]
211
- await asyncio.sleep(0)
212
-
213
- collected_content = None
214
- try:
215
- async for content in try_claude_api(system_message, claude_messages):
216
- code = content
217
- analysis = analyze_code(code)
218
- yield [
219
- code,
220
- _history,
221
- analysis,
222
- gr.update(active_key="loading"),
223
- gr.update(open=True)
224
- ]
225
- await asyncio.sleep(0)
226
- collected_content = code
227
-
228
- except Exception as claude_error:
229
- print(f"Falling back to OpenAI API due to Claude error: {str(claude_error)}")
230
-
231
- async for content in try_openai_api(openai_messages):
232
- code = content
233
- analysis = analyze_code(code)
234
- yield [
235
- code,
236
- _history,
237
- analysis,
238
- gr.update(active_key="loading"),
239
- gr.update(open=True)
240
- ]
241
- await asyncio.sleep(0)
242
- collected_content = code
243
-
244
- if collected_content:
245
- _history = messages_to_history([
246
- {'role': Role.SYSTEM, 'content': system_message}
247
- ] + claude_messages + [{
248
- 'role': Role.ASSISTANT,
249
- 'content': collected_content
250
- }])
251
-
252
  yield [
253
- collected_content,
254
- _history,
255
- analyze_code(collected_content),
256
- gr.update(active_key="render"),
257
- gr.update(open=True)
258
  ]
259
- else:
260
- raise ValueError("No content was generated from either API")
261
-
262
- except Exception as e:
263
- print(f"Error details: {str(e)}")
264
- raise ValueError(f'Error calling APIs: {str(e)}')
265
-
266
- def analyze_code(code: str) -> str:
267
- """์ฝ”๋“œ ๋ถ„์„ ๊ฒฐ๊ณผ๋ฅผ Markdown ํ˜•์‹์œผ๋กœ ๋ฐ˜ํ™˜"""
268
- analysis = []
269
-
270
- # 1. ์‚ฌ์šฉ๋œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋ถ„์„
271
- imports = []
272
- for line in code.split('\n'):
273
- if line.startswith('import ') or line.startswith('from '):
274
- imports.append(line.strip())
275
-
276
- if imports:
277
- analysis.append("## ๐Ÿ“š ์‚ฌ์šฉ๋œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ")
278
- for imp in imports:
279
- analysis.append(f"- `{imp}`")
280
- analysis.append("")
281
-
282
- # 2. ํ•จ์ˆ˜ ๋ถ„์„
283
- functions = []
284
- current_func = []
285
- in_function = False
286
-
287
- for line in code.split('\n'):
288
- if line.strip().startswith('def '):
289
- if current_func:
290
- functions.append('\n'.join(current_func))
291
- current_func = []
292
- in_function = True
293
- if in_function:
294
- current_func.append(line)
295
- if in_function and not line.strip():
296
- in_function = False
297
- if current_func:
298
- functions.append('\n'.join(current_func))
299
- current_func = []
300
-
301
- if functions:
302
- analysis.append("## ๐Ÿ”ง ์ฃผ์š” ํ•จ์ˆ˜")
303
- for func in functions:
304
- func_name = func.split('def ')[1].split('(')[0]
305
- analysis.append(f"### `{func_name}`")
306
- analysis.append(get_function_description(func))
307
- analysis.append("")
308
-
309
- # 3. UI ์ปดํฌ๋„ŒํŠธ ๋ถ„์„
310
- ui_components = []
311
- for line in code.split('\n'):
312
- if 'gr.' in line:
313
- component = line.split('gr.')[1].split('(')[0]
314
- if component not in ui_components:
315
- ui_components.append(component)
316
-
317
- if ui_components:
318
- analysis.append("## ๐ŸŽจ UI ์ปดํฌ๋„ŒํŠธ")
319
- for component in ui_components:
320
- analysis.append(f"- **{component}**: {get_component_description(component)}")
321
- analysis.append("")
322
-
323
- # 4. ์‹คํ–‰ ๋ฐฉ๋ฒ•
324
- analysis.append("## โ–ถ๏ธ ์‹คํ–‰ ๋ฐฉ๋ฒ•")
325
- analysis.append("1. '์‹คํ–‰ํ•˜๊ธฐ' ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜์—ฌ Hugging Face Space์— ๋ฐฐํฌ")
326
- analysis.append("2. ์ƒ์„ฑ๋œ ๋งํฌ๋ฅผ ํด๋ฆญํ•˜์—ฌ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์‹คํ–‰")
327
-
328
- return "\n".join(analysis)
329
 
330
  def clear_history(self):
331
  return []
@@ -1092,8 +1187,8 @@ with gr.Blocks(css_paths="app.css",theme=theme) as demo:
1092
  header = gr.HTML(f"""
1093
  <div class="left_header">
1094
  <img src="data:image/gif;base64,{get_image_base64('mouse.gif')}" width="360px" />
1095
- <h1 style="font-size: 18px;">๊ณ ์–‘์ด๋„ ๋ฐœ๋กœ ์ฝ”๋”ฉํ•˜๋Š” 'MOUSE-I'</h2>
1096
- <h1 style="font-size: 10px;">์ž…๋ ฅ์—†์ด 'Send' ๋ฒ„ํŠผ ํด๋ฆญ์‹œ ๋žœ๋คํ•œ ์˜ˆ์ œ ์ฝ”๋“œ ์ƒ์„ฑ. ์ƒ์„ฑ๋œ ์ฝ”๋“œ๋งŒ ํ”„๋กฌํ”„ํŠธ์— ๋ถ™์—ฌ๋„ฃ๊ณ  'Code ์‹คํ–‰' ๋ฒ„ํŠผ ํด๋ฆญ์‹œ ํ™”๋ฉด์— ์ฆ‰์‹œ ์„œ๋น„์Šค๊ฐ€ ์‹คํ–‰. ๋ฌธ์˜: arxivgpt@gmail.com </h2>
1097
  </div>
1098
  """)
1099
  input = antd.InputTextarea(
 
172
  print(f"OpenAI API error: {str(e)}")
173
  raise e
174
 
175
+
176
+ def analyze_code(code: str) -> str:
177
+ """์ฝ”๋“œ ๋ถ„์„ ๊ฒฐ๊ณผ๋ฅผ HTML ํ˜•์‹์œผ๋กœ ๋ฐ˜ํ™˜"""
178
+ analysis = []
179
+
180
+ # 0. ์ฝ”๋“œ ๊ฐœ์š”
181
+ analysis.append("<h2>๐Ÿ’ก ์ฝ”๋“œ ๊ฐœ์š”</h2>")
182
+ analysis.append("<p>์ด ์ฝ”๋“œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ํŠน์ง•์„ ๊ฐ€์ง€๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค:</p>")
183
+ analysis.append("<ul>")
184
+ if 'gr.Blocks' in code:
185
+ analysis.append("<li>Gradio Blocks๋ฅผ ์‚ฌ์šฉํ•œ ๋ชจ๋˜ํ•œ UI ๊ตฌ์„ฑ</li>")
186
+ if 'theme=' in code:
187
+ analysis.append("<li>์ปค์Šคํ…€ ํ…Œ๋งˆ ์ ์šฉ์œผ๋กœ ์‹œ๊ฐ์  ์ผ๊ด€์„ฑ ์œ ์ง€</li>")
188
+ if 'with gr.Row' in code or 'with gr.Column' in code:
189
+ analysis.append("<li>Row/Column ๋ ˆ์ด์•„์›ƒ์œผ๋กœ ๋ฐ˜์‘ํ˜• ๋””์ž์ธ ๊ตฌํ˜„</li>")
190
+ analysis.append("</ul>")
191
+
192
+ # 1. ์‚ฌ์šฉ๋œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋ถ„์„
193
+ imports = []
194
+ required_packages = set()
195
+ for line in code.split('\n'):
196
+ if line.startswith('import ') or line.startswith('from '):
197
+ imports.append(line.strip())
198
+ # ํŒจํ‚ค์ง€ ์ด๋ฆ„ ์ถ”์ถœ
199
+ if line.startswith('import '):
200
+ package = line.split('import ')[1].split()[0].split('.')[0]
201
+ else:
202
+ package = line.split('from ')[1].split()[0].split('.')[0]
203
+ required_packages.add(package)
204
+
205
+ if imports:
206
+ analysis.append("<h2>๐Ÿ“š ํ•„์š”ํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ</h2>")
207
+ analysis.append("<ul>")
208
+ for imp in imports:
209
+ analysis.append(f"<li><code>{imp}</code></li>")
210
+ analysis.append("</ul>")
211
+
212
+ # requirements.txt ์„ค๋ช… ์ถ”๊ฐ€
213
+ analysis.append("<h3>๐Ÿ“‹ Requirements.txt</h3>")
214
+ analysis.append("<p>์ด ์•ฑ์„ ์‹คํ–‰ํ•˜๊ธฐ ์œ„ํ•ด ํ•„์š”ํ•œ ํŒจํ‚ค์ง€๋“ค์ž…๋‹ˆ๋‹ค:</p>")
215
+ analysis.append("<pre>")
216
+ for pkg in sorted(required_packages):
217
+ if pkg == 'gradio':
218
+ analysis.append("gradio==5.5.0")
219
+ else:
220
+ analysis.append(pkg)
221
+ analysis.append("</pre>")
222
+
223
+ # 2. ํ•จ์ˆ˜ ๋ถ„์„
224
+ functions = []
225
+ current_func = []
226
+ in_function = False
227
+
228
+ for line in code.split('\n'):
229
+ if line.strip().startswith('def '):
230
+ if current_func:
231
+ functions.append('\n'.join(current_func))
232
+ current_func = []
233
+ in_function = True
234
+ if in_function:
235
+ current_func.append(line)
236
+ if in_function and not line.strip():
237
+ in_function = False
238
+ if current_func:
239
+ functions.append('\n'.join(current_func))
240
+ current_func = []
241
+
242
+ if functions:
243
+ analysis.append("<h2>๐Ÿ”ง ์ฃผ์š” ํ•จ์ˆ˜ ์„ค๋ช…</h2>")
244
+ for func in functions:
245
+ func_name = func.split('def ')[1].split('(')[0]
246
+ analysis.append(f"<h3><code>{func_name}</code></h3>")
247
+ analysis.append(f"<p>{get_function_description(func)}</p>")
248
+ # ํ•จ์ˆ˜ ํŒŒ๋ผ๋ฏธํ„ฐ ๋ถ„์„
249
+ params = func.split('(')[1].split(')')[0]
250
+ if params.strip():
251
+ analysis.append("<p>ํŒŒ๋ผ๋ฏธํ„ฐ:</p><ul>")
252
+ for param in params.split(','):
253
+ param = param.strip()
254
+ if param and param != 'self':
255
+ analysis.append(f"<li><code>{param}</code></li>")
256
+ analysis.append("</ul>")
257
+
258
+ # 3. UI ์ปดํฌ๋„ŒํŠธ ๋ถ„์„
259
+ ui_components = []
260
+ for line in code.split('\n'):
261
+ if 'gr.' in line:
262
+ component = line.split('gr.')[1].split('(')[0]
263
+ if component not in ui_components:
264
+ ui_components.append(component)
265
+
266
+ if ui_components:
267
+ analysis.append("<h2>๐ŸŽจ UI ๊ตฌ์„ฑ์š”์†Œ</h2>")
268
+ analysis.append("<p>์ด ์•ฑ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์€ Gradio ์ปดํฌ๋„ŒํŠธ๋“ค๋กœ ๊ตฌ์„ฑ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค:</p>")
269
+ analysis.append("<ul>")
270
+ for component in ui_components:
271
+ analysis.append(f"<li><strong>{component}</strong>: {get_component_description(component)}</li>")
272
+ analysis.append("</ul>")
273
+
274
+ # 4. ํŠน์ง• ๋ฐ ๊ธฐ๋Šฅ
275
+ analysis.append("<h2>โœจ ์ฃผ์š” ํŠน์ง•</h2>")
276
+ analysis.append("<ul>")
277
+ if 'theme=' in code:
278
+ analysis.append("<li>์ปค์Šคํ…€ ํ…Œ๋งˆ ์ ์šฉ์œผ๋กœ ์ผ๊ด€๋œ ๋””์ž์ธ</li>")
279
+ if 'with gr.Row' in code:
280
+ analysis.append("<li>๋ฐ˜์‘ํ˜• ๋ ˆ์ด์•„์›ƒ์œผ๋กœ ๋‹ค์–‘ํ•œ ํ™”๋ฉด ํฌ๊ธฐ ์ง€์›</li>")
281
+ if 'gr.State' in code:
282
+ analysis.append("<li>์ƒํƒœ ๊ด€๋ฆฌ๋ฅผ ํ†ตํ•œ ๋ฐ์ดํ„ฐ ์œ ์ง€</li>")
283
+ if '.click(' in code:
284
+ analysis.append("<li>์ด๋ฒคํŠธ ํ•ธ๋“ค๋ง์„ ํ†ตํ•œ ๋™์  ์ƒํ˜ธ์ž‘์šฉ</li>")
285
+ analysis.append("</ul>")
286
+
287
+ # 5. ์‹คํ–‰ ๋ฐฉ๋ฒ•
288
+ analysis.append("<h2>โ–ถ๏ธ ์‹คํ–‰ ๋ฐฉ๋ฒ•</h2>")
289
+ analysis.append("<ol>")
290
+ analysis.append("<li>'์‹คํ–‰ํ•˜๊ธฐ' ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜์—ฌ Hugging Face Space์— ๋ฐฐํฌ</li>")
291
+ analysis.append("<li>์ƒ์„ฑ๋œ ๋งํฌ๋ฅผ ํด๋ฆญํ•˜์—ฌ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์‹คํ–‰</li>")
292
+ analysis.append("<li>ํ•„์š”ํ•œ ์ž…๋ ฅ๊ฐ’์„ ์ œ๊ณตํ•˜๊ณ  ์ƒํ˜ธ์ž‘์šฉ ์‹œ์ž‘</li>")
293
+ analysis.append("</ol>")
294
+
295
+ return "\n".join(analysis)
296
+
297
+ def get_function_description(func: str) -> str:
298
+ """ํ•จ์ˆ˜์˜ ๋ชฉ์ ์„ ์„ค๋ช…ํ•˜๋Š” ๋ฌธ์ž์—ด ๋ฐ˜ํ™˜"""
299
+ if 'get_multiplication_table' in func:
300
+ return "์ž…๋ ฅ๋ฐ›์€ ์ˆซ์ž์˜ ๊ตฌ๊ตฌ๋‹จ์„ ๊ณ„์‚ฐํ•˜์—ฌ ๋ฌธ์ž์—ด๋กœ ๋ฐ˜ํ™˜"
301
+ elif 'get_all_tables' in func:
302
+ return "2๋‹จ๋ถ€ํ„ฐ 9๋‹จ๊นŒ์ง€ ์ „์ฒด ๊ตฌ๊ตฌ๋‹จ์„ ์ƒ์„ฑํ•˜์—ฌ ๋ฐ˜ํ™˜"
303
+ # ๋‹ค๋ฅธ ํ•จ์ˆ˜๋“ค์— ๋Œ€ํ•œ ์„ค๋ช… ์ถ”๊ฐ€
304
+ return "ํ•จ์ˆ˜์˜ ๊ธฐ๋Šฅ ์„ค๋ช…"
305
+
306
+ def get_component_description(component: str) -> str:
307
+ """UI ์ปดํฌ๋„ŒํŠธ์— ๋Œ€ํ•œ ์„ค๋ช… ๋ฐ˜ํ™˜"""
308
+ descriptions = {
309
+ 'Number': '์ˆซ์ž ์ž…๋ ฅ ํ•„๋“œ',
310
+ 'Button': 'ํด๋ฆญ ๊ฐ€๋Šฅํ•œ ๋ฒ„ํŠผ',
311
+ 'Textbox': 'ํ…์ŠคํŠธ ์ถœ๋ ฅ ์˜์—ญ',
312
+ 'Markdown': '๋งˆํฌ๋‹ค์šด ํ˜•์‹์˜ ํ…์ŠคํŠธ ํ‘œ์‹œ',
313
+ 'Row': '์ˆ˜ํ‰ ๋ฐฉํ–ฅ ๋ ˆ์ด์•„์›ƒ',
314
+ 'Column': '์ˆ˜์ง ๋ฐฉํ–ฅ ๋ ˆ์ด์•„์›ƒ',
315
+ 'Blocks': '์ „์ฒด UI ์ปจํ…Œ์ด๋„ˆ',
316
+ 'Image': '์ด๋ฏธ์ง€ ํ‘œ์‹œ ์ปดํฌ๋„ŒํŠธ',
317
+ 'File': 'ํŒŒ์ผ ์—…๋กœ๋“œ ์ปดํฌ๋„ŒํŠธ',
318
+ 'Slider': '์Šฌ๋ผ์ด๋” ์ž…๋ ฅ ์ปดํฌ๋„ŒํŠธ',
319
+ 'Dropdown': '๋“œ๋กญ๋‹ค์šด ์„ ํƒ ์ปดํฌ๋„ŒํŠธ',
320
+ 'Radio': '๋ผ๋””์˜ค ๋ฒ„ํŠผ ๊ทธ๋ฃน',
321
+ 'Checkbox': '์ฒดํฌ๋ฐ•์Šค ์ปดํฌ๋„ŒํŠธ',
322
+ 'Audio': '์˜ค๋””์˜ค ์žฌ์ƒ/๋…น์Œ ์ปดํฌ๋„ŒํŠธ',
323
+ 'Video': '๋น„๋””์˜ค ์žฌ์ƒ ์ปดํฌ๋„ŒํŠธ',
324
+ 'HTML': 'HTML ์ฝ˜ํ…์ธ  ํ‘œ์‹œ',
325
+ 'JSON': 'JSON ๋ฐ์ดํ„ฐ ํ‘œ์‹œ',
326
+ 'DataFrame': '๋ฐ์ดํ„ฐํ”„๋ ˆ์ž„ ํ‘œ์‹œ',
327
+ 'Plot': '๊ทธ๋ž˜ํ”„/์ฐจํŠธ ํ‘œ์‹œ',
328
+ 'Label': '๋ ˆ์ด๋ธ” ํ…์ŠคํŠธ ํ‘œ์‹œ'
329
+ }
330
+ return descriptions.get(component, '์ปดํฌ๋„ŒํŠธ ์„ค๋ช…')
331
+
332
+
333
+
334
  class Demo:
335
  def __init__(self):
336
  pass
337
+
338
  async def generation_code(self, query: Optional[str], _setting: Dict[str, str], _history: Optional[History]):
339
+ if not query or query.strip() == '':
340
+ query = random.choice(DEMO_LIST)['description']
341
+
342
+ if _history is None:
343
+ _history = []
344
+
345
+ messages = history_to_messages(_history, _setting['system'])
346
+ system_message = messages[0]['content']
347
+
348
+ claude_messages = [
349
+ {"role": msg["role"] if msg["role"] != "system" else "user", "content": msg["content"]}
350
+ for msg in messages[1:] + [{'role': Role.USER, 'content': query}]
351
+ if msg["content"].strip() != ''
352
+ ]
353
+
354
+ openai_messages = [{"role": "system", "content": system_message}]
355
+ for msg in messages[1:]:
356
+ openai_messages.append({
357
+ "role": msg["role"],
358
+ "content": msg["content"]
359
+ })
360
+ openai_messages.append({"role": "user", "content": query})
361
+
362
+ try:
363
+ yield [
364
+ "Generating code...",
365
+ _history,
366
+ None,
367
+ gr.update(active_key="loading"),
368
+ gr.update(open=True)
369
+ ]
370
+ await asyncio.sleep(0)
371
+
372
+ collected_content = None
373
+ try:
374
+ async for content in try_claude_api(system_message, claude_messages):
375
+ code = content
376
+ analysis = analyze_code(code)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
377
  yield [
378
+ code,
379
+ _history,
380
+ analysis, # ๋ถ„์„ ๊ฒฐ๊ณผ๋ฅผ HTML๋กœ ์ „๋‹ฌ
381
+ gr.update(active_key="loading"),
382
+ gr.update(open=True)
383
  ]
384
+ await asyncio.sleep(0)
385
+ collected_content = code
386
+
387
+ except Exception as claude_error:
388
+ print(f"Falling back to OpenAI API due to Claude error: {str(claude_error)}")
389
+
390
+ async for content in try_openai_api(openai_messages):
391
+ code = content
392
+ analysis = analyze_code(code)
393
+ yield [
394
+ code,
395
+ _history,
396
+ analysis, # ๋ถ„์„ ๊ฒฐ๊ณผ๋ฅผ HTML๋กœ ์ „๋‹ฌ
397
+ gr.update(active_key="loading"),
398
+ gr.update(open=True)
399
+ ]
400
+ await asyncio.sleep(0)
401
+ collected_content = code
402
+
403
+ if collected_content:
404
+ _history = messages_to_history([
405
+ {'role': Role.SYSTEM, 'content': system_message}
406
+ ] + claude_messages + [{
407
+ 'role': Role.ASSISTANT,
408
+ 'content': collected_content
409
+ }])
410
+
411
+ yield [
412
+ collected_content,
413
+ _history,
414
+ analyze_code(collected_content), # ์ตœ์ข… ๋ถ„์„ ๊ฒฐ๊ณผ๋ฅผ HTML๋กœ ์ „๋‹ฌ
415
+ gr.update(active_key="render"),
416
+ gr.update(open=True)
417
+ ]
418
+ else:
419
+ raise ValueError("No content was generated from either API")
420
+
421
+ except Exception as e:
422
+ print(f"Error details: {str(e)}")
423
+ raise ValueError(f'Error calling APIs: {str(e)}')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
424
 
425
  def clear_history(self):
426
  return []
 
1187
  header = gr.HTML(f"""
1188
  <div class="left_header">
1189
  <img src="data:image/gif;base64,{get_image_base64('mouse.gif')}" width="360px" />
1190
+ <h1 style="font-size: 18px;">๊ณ ์–‘์ด๋„ ๋ฐœ๋กœ ์ฝ”๋”ฉํ•˜๋Š” 'MOUSE-II'</h2>
1191
+ <h1 style="font-size: 10px;">ํ…œํ”Œ๋ฆฟ์˜ ํ”„๋กฌํ”„ํŠธ ๋‚ด์šฉ์„ ๋ณต์‚ฌํ•ด ํ”„๋กฌํ”„ํŠธ์— ์ž…๋ ฅ 'Send'๋ฒ„ํŠผ ํด๋ฆญ -> '์‹คํ–‰ํ•˜๊ธฐ' ๋ฒ„ํŠผ ํด๋ฆญํ•˜์—ฌ ์ฝ”๋“œ ์‹คํ–‰. ๋ฌธ์˜: arxivgpt@gmail.com </h2>
1192
  </div>
1193
  """)
1194
  input = antd.InputTextarea(