Spaces:
Runtime error
Runtime error
Commit
·
e78d7c7
1
Parent(s):
6797e2d
update playwright func
Browse files
app.py
CHANGED
|
@@ -87,7 +87,7 @@ import re
|
|
| 87 |
from transformers import SpeechT5Processor, SpeechT5ForTextToSpeech, SpeechT5HifiGan
|
| 88 |
import torch
|
| 89 |
from codeinterpreterapi import CodeInterpreterSession
|
| 90 |
-
|
| 91 |
|
| 92 |
async def TestCodeInterpret(CustomMessage:str):
|
| 93 |
# create a session
|
|
@@ -284,7 +284,10 @@ async def start_playwright(question: str):
|
|
| 284 |
# print("output_text 1", output_text)
|
| 285 |
output_history = "NOTHING"
|
| 286 |
for i in range(100):
|
| 287 |
-
|
|
|
|
|
|
|
|
|
|
| 288 |
print("output_text... :")
|
| 289 |
|
| 290 |
if output_text == output_history and '▌' not in output_text and output_text != "":
|
|
|
|
| 87 |
from transformers import SpeechT5Processor, SpeechT5ForTextToSpeech, SpeechT5HifiGan
|
| 88 |
import torch
|
| 89 |
from codeinterpreterapi import CodeInterpreterSession
|
| 90 |
+
import html2text
|
| 91 |
|
| 92 |
async def TestCodeInterpret(CustomMessage:str):
|
| 93 |
# create a session
|
|
|
|
| 284 |
# print("output_text 1", output_text)
|
| 285 |
output_history = "NOTHING"
|
| 286 |
for i in range(100):
|
| 287 |
+
output_text_old = await page.locator("//div[@aria-label='Chat message from assistant']").last.inner_text()
|
| 288 |
+
html_content = await page.locator("//div[@aria-label='Chat message from assistant']").last.inner_html()
|
| 289 |
+
markdown_converter = html2text.HTML2Text()
|
| 290 |
+
output_text = markdown_converter.handle(html_content)
|
| 291 |
print("output_text... :")
|
| 292 |
|
| 293 |
if output_text == output_history and '▌' not in output_text and output_text != "":
|