seawolf2357 commited on
Commit
9881e9e
ยท
verified ยท
1 Parent(s): 882eb49

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -67,8 +67,12 @@ class MyClient(discord.Client):
67
 
68
  async def handle_math_question(self, question):
69
  loop = asyncio.get_event_loop()
70
- response = await loop.run_in_executor(None, lambda: math_pipe([{"role": "user", "content": question}]))
71
- return response[0]['generated_text']
 
 
 
 
72
 
73
  async def generate_response(self, message):
74
  global conversation_history
 
67
 
68
  async def handle_math_question(self, question):
69
  loop = asyncio.get_event_loop()
70
+ response = await loop.run_in_executor(None, lambda: self.math_pipe([{"role": "user", "content": question}]))
71
+ # ์ˆ˜ํ•™์  ์ˆ˜์‹์„ LaTeX ํฌ๋งท์œผ๋กœ ๊ฐ์‹ธ๊ธฐ
72
+ math_response = response[0]['generated_text']
73
+ # ๋””์Šค์ฝ”๋“œ์—์„œ LaTeX ์ˆ˜์‹์œผ๋กœ ๋ณด์—ฌ์ฃผ๊ธฐ ์œ„ํ•œ ํ˜•์‹
74
+ latex_output = f"$$\n{math_response}\n$$"
75
+ return latex_output
76
 
77
  async def generate_response(self, message):
78
  global conversation_history