Update app.py
Browse files
app.py
CHANGED
@@ -360,8 +360,8 @@ async def website_summarizer(url: str):
|
|
360 |
response = requests.get(url, headers={"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0"})
|
361 |
response.raise_for_status()
|
362 |
visible_text = extract_text_from_webpage(response.text)
|
363 |
-
if len(visible_text) >
|
364 |
-
visible_text = visible_text[:
|
365 |
|
366 |
# Use chat model to summarize the extracted text
|
367 |
with WEBS() as webs:
|
|
|
360 |
response = requests.get(url, headers={"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0"})
|
361 |
response.raise_for_status()
|
362 |
visible_text = extract_text_from_webpage(response.text)
|
363 |
+
if len(visible_text) > 7500: # Adjust max_chars based on your needs
|
364 |
+
visible_text = visible_text[:7500] + "..."
|
365 |
|
366 |
# Use chat model to summarize the extracted text
|
367 |
with WEBS() as webs:
|