Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +3 -0
src/streamlit_app.py
CHANGED
|
@@ -19,6 +19,9 @@ def load_text(url):
|
|
| 19 |
"""Load the article/blog post from a URL"""
|
| 20 |
try:
|
| 21 |
loader = WebBaseLoader(url)
|
|
|
|
|
|
|
|
|
|
| 22 |
docs = loader.load()
|
| 23 |
return docs[0].page_content if docs else None
|
| 24 |
except Exception as e:
|
|
|
|
| 19 |
"""Load the article/blog post from a URL"""
|
| 20 |
try:
|
| 21 |
loader = WebBaseLoader(url)
|
| 22 |
+
loader.requests_kwargs = {
|
| 23 |
+
'headers': {'User-Agent': 'SummarizerBot/1.0 (https://your-site.com)'}
|
| 24 |
+
}
|
| 25 |
docs = loader.load()
|
| 26 |
return docs[0].page_content if docs else None
|
| 27 |
except Exception as e:
|