Skip to content

Commit

Permalink
Merge pull request #72 from leozqin/fix-summarization
Browse files Browse the repository at this point in the history
Fix summarization
  • Loading branch information
leozqin authored Oct 30, 2024
2 parents 90d1623 + 0e4a638 commit 4dec910
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions app/llm/ollama.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def _make_chat_call(self, system: str, prompt: str):
return chat["message"]["content"]

def summarize(self, feed: Feed, entry: FeedEntry, mk: str):
system = self.system if self.system else self.system_prompt
system = self.system if self.system else self.summarization_system_prompt

return self._make_chat_call(system=system, prompt=self.get_prompt(mk))
return self._make_chat_call(
system=system, prompt=self.get_summarization_prompt(mk)
)
4 changes: 2 additions & 2 deletions app/llm/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ def summarize(self, feed: Feed, entry: FeedEntry, mk: str):

completion = client.chat.completions.create(
messages=[
{"role": "system", "content": self.system_prompt},
{"role": "user", "content": self.get_prompt(mk=mk)},
{"role": "system", "content": self.summarization_system_prompt},
{"role": "user", "content": self.get_summarization_prompt(mk=mk)},
],
model=self.model,
n=1,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "precis"
version = "0.3.1"
version = "0.3.2"
description = "A framework for automating your media diet"
requires-python = ">=3.11"
license = {file = "LICENSE"}
Expand Down

0 comments on commit 4dec910

Please sign in to comment.