Skip to content

Commit 43d67db

Browse files
author
Cambio ML
authored
Merge pull request #224 from CambioML/dev
Add summary prompt and bump version to 0.0.30
2 parents b1a2679 + d74af14 commit 43d67db

File tree

4 files changed

+29
-3
lines changed

4 files changed

+29
-3
lines changed

example/toc.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"metadata": {},
1414
"outputs": [],
1515
"source": [
16-
"!pip3 install -q pandas tabulate uniflow==0.0.29\n"
16+
"!pip3 install -q pandas tabulate uniflow==0.0.30\n"
1717
]
1818
},
1919
{

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "uniflow"
3-
version = "0.0.29"
3+
version = "0.0.30"
44
description = "Unified interface for pre-training data augmentation and post-training evaluation of Large Language Models (LLMs)."
55
authors = ["CambioML <[email protected]>"]
66
maintainers = ["Rachel Hu <[email protected]>"]

uniflow/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
__all__ = ["PromptTemplate", "Context"]
66

7-
__version__ = "0.0.29"
7+
__version__ = "0.0.30"

uniflow/flow/config.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,32 @@ class TransformConfig:
131131
auto_split_long_text: bool = field(default=False)
132132

133133

134+
@dataclass
135+
class TransformSummaryConfig(TransformConfig):
136+
"""Transform Summary Config Class."""
137+
138+
flow_name: str = "TransformOpenAIFlow"
139+
model_config: ModelConfig = field(default_factory=OpenAIModelConfig)
140+
num_thread: int = 1
141+
prompt_template: PromptTemplate = field(
142+
default_factory=lambda: PromptTemplate(
143+
instruction="""
144+
Given a lengthy and detailed text, the task is to generate a concise and accurate summary that captures the main points, themes, and conclusions without losing the essence of the original content.
145+
The summary should be coherent, readable, and no longer than a few sentences, making it easily understandable at a glance.
146+
It must distill complex ideas and narratives into their core insights, highlighting critical information while omitting extraneous details.
147+
The goal is to provide a clear and succinct overview that enables readers to grasp the significance and overarching narrative of the full text quickly.
148+
""",
149+
few_shot_prompt=[
150+
Context(
151+
context="...",
152+
summary="...",
153+
),
154+
],
155+
)
156+
)
157+
auto_split_long_text: bool = field(default=False)
158+
159+
134160
@dataclass
135161
class TransformGmailSpamConfig(TransformConfig):
136162
"""Transform Google Config Class."""

0 commit comments

Comments
 (0)