Spaces:
Runtime error
Runtime error
Commit
·
f7bfe98
1
Parent(s):
4a9bf73
improve memory
Browse files
app.py
CHANGED
@@ -65,6 +65,8 @@ import langchain
|
|
65 |
import asyncio
|
66 |
from playwright.async_api import async_playwright
|
67 |
|
|
|
|
|
68 |
async def start_playwright():
|
69 |
pw = await async_playwright().start()
|
70 |
browser = await pw.chromium.launch(headless=True)
|
@@ -93,7 +95,8 @@ async def start_playwright():
|
|
93 |
for i in range(40):
|
94 |
output_text = await page.locator("//div[@aria-label='Chat message from assistant']").last.inner_text()
|
95 |
print("output_text... :", output_text)
|
96 |
-
|
|
|
97 |
break
|
98 |
else:
|
99 |
await page.wait_for_timeout(1000)
|
|
|
65 |
import asyncio
|
66 |
from playwright.async_api import async_playwright
|
67 |
|
68 |
+
os.environ['MPLCONFIGDIR'] = os.path.expanduser('/home/user/matplotlib_cache')
|
69 |
+
|
70 |
async def start_playwright():
|
71 |
pw = await async_playwright().start()
|
72 |
browser = await pw.chromium.launch(headless=True)
|
|
|
95 |
for i in range(40):
|
96 |
output_text = await page.locator("//div[@aria-label='Chat message from assistant']").last.inner_text()
|
97 |
print("output_text... :", output_text)
|
98 |
+
|
99 |
+
if output_text == output_history and '▌' not in output_text:
|
100 |
break
|
101 |
else:
|
102 |
await page.wait_for_timeout(1000)
|