Spaces:
Build error
Build error
Ilia Tambovtsev commited on
Commit ·
b11e194
1
Parent(s): 310485e
feat: add fresh start option to PresentationAnalysis
Browse files- src/chains/pipelines.py +3 -1
src/chains/pipelines.py
CHANGED
|
@@ -143,6 +143,7 @@ class PresentationPipeline(Chain):
|
|
| 143 |
vision_prompt: str = "Describe this slide in detail",
|
| 144 |
dpi: int = 72,
|
| 145 |
base_path: Optional[Path] = None,
|
|
|
|
| 146 |
save_steps: bool = True,
|
| 147 |
save_final: bool = True,
|
| 148 |
**kwargs
|
|
@@ -163,6 +164,7 @@ class PresentationPipeline(Chain):
|
|
| 163 |
dpi=dpi
|
| 164 |
)
|
| 165 |
self._base_path = base_path
|
|
|
|
| 166 |
self._save_steps = save_steps
|
| 167 |
self._save_final = save_final
|
| 168 |
|
|
@@ -255,7 +257,7 @@ class PresentationPipeline(Chain):
|
|
| 255 |
# Try to load existing results
|
| 256 |
presentation = (
|
| 257 |
PresentationAnalysis.load(latest_analysis)
|
| 258 |
-
if latest_analysis
|
| 259 |
else PresentationAnalysis(
|
| 260 |
name=pdf_path.stem,
|
| 261 |
path=pdf_path,
|
|
|
|
| 143 |
vision_prompt: str = "Describe this slide in detail",
|
| 144 |
dpi: int = 72,
|
| 145 |
base_path: Optional[Path] = None,
|
| 146 |
+
fresh_start: bool = True,
|
| 147 |
save_steps: bool = True,
|
| 148 |
save_final: bool = True,
|
| 149 |
**kwargs
|
|
|
|
| 164 |
dpi=dpi
|
| 165 |
)
|
| 166 |
self._base_path = base_path
|
| 167 |
+
self._fresh_start = fresh_start
|
| 168 |
self._save_steps = save_steps
|
| 169 |
self._save_final = save_final
|
| 170 |
|
|
|
|
| 257 |
# Try to load existing results
|
| 258 |
presentation = (
|
| 259 |
PresentationAnalysis.load(latest_analysis)
|
| 260 |
+
if latest_analysis and not self._fresh_start
|
| 261 |
else PresentationAnalysis(
|
| 262 |
name=pdf_path.stem,
|
| 263 |
path=pdf_path,
|