Spaces:
Running
Running
seawolf2357
commited on
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
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
|