Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -23,7 +23,7 @@ def scrape_content(url):
|
|
23 |
|
24 |
# Function to summarize content using OpenAI
|
25 |
def summarize_content(content):
|
26 |
-
prompt = f"Summarize the following news article in about
|
27 |
|
28 |
response = openai.chat.completions.create(
|
29 |
model="gpt-4o-mini",
|
@@ -31,8 +31,8 @@ def summarize_content(content):
|
|
31 |
{"role": "system", "content": "You are a helpful assistant that summarizes news articles in about 60 words."},
|
32 |
{"role": "user", "content": prompt}
|
33 |
],
|
34 |
-
max_tokens=
|
35 |
-
temperature=0.
|
36 |
)
|
37 |
|
38 |
summary = response.choices[0].message.content.strip()
|
|
|
23 |
|
24 |
# Function to summarize content using OpenAI
|
25 |
def summarize_content(content):
|
26 |
+
prompt = f"Summarize the following news article in about 100 words:\n\n{content}\n\n"
|
27 |
|
28 |
response = openai.chat.completions.create(
|
29 |
model="gpt-4o-mini",
|
|
|
31 |
{"role": "system", "content": "You are a helpful assistant that summarizes news articles in about 60 words."},
|
32 |
{"role": "user", "content": prompt}
|
33 |
],
|
34 |
+
max_tokens=300,
|
35 |
+
temperature=0.2
|
36 |
)
|
37 |
|
38 |
summary = response.choices[0].message.content.strip()
|