Prompthumanizer commited on
Commit
7db7563
ยท
verified ยท
1 Parent(s): 7a10538

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -19
app.py CHANGED
@@ -262,21 +262,6 @@ class JainArchitectureCore:
262
  # ์ „์—ญ ์ œ์ธ ์ธ์Šคํ„ด์Šค ์ƒ์„ฑ
263
  jain_core = JainArchitectureCore()
264
 
265
- def chat_with_jain(message: str, history: List[List[str]]) -> Tuple[str, List[List[str]]]:
266
- """
267
- ์ œ์ธ๊ณผ์˜ ์ฑ„ํŒ… ์ธํ„ฐํŽ˜์ด์Šค
268
- """
269
- if not message.strip():
270
- return "", history
271
-
272
- # ์ œ์ธ์˜ ์‘๋‹ต ์ƒ์„ฑ
273
- jain_response = jain_core.process_thought(message)
274
-
275
- # ํžˆ์Šคํ† ๋ฆฌ ์—…๋ฐ์ดํŠธ
276
- new_history = history + [[message, jain_response]]
277
-
278
- return "", new_history
279
-
280
  def get_system_info() -> str:
281
  """์‹œ์Šคํ…œ ์ •๋ณด ๋ฐ˜ํ™˜"""
282
  return f"""
@@ -392,21 +377,36 @@ def create_jain_interface():
392
  """)
393
 
394
  # ์ด๋ฒคํŠธ ํ•ธ๋“ค๋Ÿฌ ์„ค์ •
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
395
  msg.submit(
396
- chat_with_jain,
397
  inputs=[msg, chatbot],
398
  outputs=[msg, chatbot]
399
  )
400
 
401
  send_btn.click(
402
- chat_with_jain,
403
  inputs=[msg, chatbot],
404
  outputs=[msg, chatbot]
405
  )
406
 
407
  clear_btn.click(
408
- lambda: ([], []),
409
- outputs=[chatbot, chatbot]
410
  )
411
 
412
  refresh_btn.click(
 
262
  # ์ „์—ญ ์ œ์ธ ์ธ์Šคํ„ด์Šค ์ƒ์„ฑ
263
  jain_core = JainArchitectureCore()
264
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
265
  def get_system_info() -> str:
266
  """์‹œ์Šคํ…œ ์ •๋ณด ๋ฐ˜ํ™˜"""
267
  return f"""
 
377
  """)
378
 
379
  # ์ด๋ฒคํŠธ ํ•ธ๋“ค๋Ÿฌ ์„ค์ •
380
+ def handle_message(message, history):
381
+ if not message.strip():
382
+ return "", history
383
+
384
+ # ์ œ์ธ์˜ ์‘๋‹ต ์ƒ์„ฑ
385
+ jain_response = jain_core.process_thought(message)
386
+
387
+ # ํžˆ์Šคํ† ๋ฆฌ ์—…๋ฐ์ดํŠธ
388
+ new_history = history + [[message, jain_response]]
389
+
390
+ return "", new_history
391
+
392
+ def clear_chat():
393
+ return []
394
+
395
  msg.submit(
396
+ handle_message,
397
  inputs=[msg, chatbot],
398
  outputs=[msg, chatbot]
399
  )
400
 
401
  send_btn.click(
402
+ handle_message,
403
  inputs=[msg, chatbot],
404
  outputs=[msg, chatbot]
405
  )
406
 
407
  clear_btn.click(
408
+ clear_chat,
409
+ outputs=[chatbot]
410
  )
411
 
412
  refresh_btn.click(