dindizz commited on
Commit
a0df58a
·
verified ·
1 Parent(s): aecbd98

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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 60 words:\n\n{content}\n\n"
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=80,
35
- temperature=0.7
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()