Skip to content

Commit

Permalink
fix: address the too many articles problem
Browse files Browse the repository at this point in the history
  • Loading branch information
engineervix committed Feb 5, 2024
1 parent 5b4f087 commit 79ee3aa
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions app/core/podcast/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
from pydantic import HttpUrl

from app.core.db.models import Article, Episode

# from app.core.summarization.backends.together import brief_summary
from app.core.summarization.backends.together import brief_summary
from app.core.utilities import (
DATA_DIR,
# OPENAI_API_KEY,
Expand Down Expand Up @@ -95,13 +94,16 @@ def create_transcript(news: list[dict[str, str]], dest: str, summarizer: Callabl
title = article["title"]
text = article["content"]

# if len(news) < 15:
# # If there are less than 15 articles, summarize each article in the usual way
# summary = summarizer(text, title)
# else:
# summary = brief_summary(text, title)
if len(news) < 24:
# If there are less than 24 articles, summarize each article in the usual way
summary = summarizer(text, title)
else:
if counter % 2 == 0:
summary = summarizer(text, title)
else:
summary = brief_summary(text, title)

summary = summarizer(text, title)
# summary = summarizer(text, title)

if summary.strip().startswith("Summary: "):
summary = summary.replace("Summary: ", "")
Expand Down

0 comments on commit 79ee3aa

Please sign in to comment.