Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,13 +10,13 @@ model = "deepseek-ai/DeepSeek-R1-Distill-Qwen-7B"
|
|
10 |
#nlp = pipeline("question-answering")
|
11 |
#summarizer = pipeline("summarization")
|
12 |
nlp = pipeline(model=model)
|
13 |
-
summarizer = pipeline(model=model)
|
14 |
|
15 |
def fetch_and_summarize(url):
|
16 |
response = requests.get(url)
|
17 |
soup = BeautifulSoup(response.text, 'html.parser')
|
18 |
content = soup.get_text()
|
19 |
-
summary =
|
20 |
print(summary)
|
21 |
print(summary[0])
|
22 |
return summary[0]['summary']
|
|
|
10 |
#nlp = pipeline("question-answering")
|
11 |
#summarizer = pipeline("summarization")
|
12 |
nlp = pipeline(model=model)
|
13 |
+
#summarizer = pipeline(model=model)
|
14 |
|
15 |
def fetch_and_summarize(url):
|
16 |
response = requests.get(url)
|
17 |
soup = BeautifulSoup(response.text, 'html.parser')
|
18 |
content = soup.get_text()
|
19 |
+
summary = nlp(content[:10000]) # Limit content to avoid overwhelming the model
|
20 |
print(summary)
|
21 |
print(summary[0])
|
22 |
return summary[0]['summary']
|