Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -9,6 +9,7 @@ from requests.adapters import HTTPAdapter
|
|
9 |
from requests.packages.urllib3.util.retry import Retry
|
10 |
from openai import OpenAI
|
11 |
from bs4 import BeautifulSoup
|
|
|
12 |
|
13 |
ACCESS_TOKEN = os.getenv("HF_TOKEN")
|
14 |
if not ACCESS_TOKEN:
|
@@ -951,6 +952,7 @@ def get_article_content(url):
|
|
951 |
return full_content.strip()
|
952 |
|
953 |
except Exception as e:
|
|
|
954 |
return f"Error crawling content: {str(e)}"
|
955 |
|
956 |
def respond(url, history, system_message, max_tokens, temperature, top_p):
|
|
|
9 |
from requests.packages.urllib3.util.retry import Retry
|
10 |
from openai import OpenAI
|
11 |
from bs4 import BeautifulSoup
|
12 |
+
import re # re 모듈 추가
|
13 |
|
14 |
ACCESS_TOKEN = os.getenv("HF_TOKEN")
|
15 |
if not ACCESS_TOKEN:
|
|
|
952 |
return full_content.strip()
|
953 |
|
954 |
except Exception as e:
|
955 |
+
print(f"Crawling error details: {str(e)}") # 디버깅을 위한 상세 에러 출력
|
956 |
return f"Error crawling content: {str(e)}"
|
957 |
|
958 |
def respond(url, history, system_message, max_tokens, temperature, top_p):
|