Spaces:
Running
on
Zero
Running
on
Zero
Update src/constructor.py
Browse files- src/constructor.py +6 -5
src/constructor.py
CHANGED
@@ -23,6 +23,7 @@ def generate_presentation(
|
|
23 |
generate_image: Callable[[str, int, int], Image.Image],
|
24 |
prompt_config: PromptConfig,
|
25 |
description: str,
|
|
|
26 |
font:Font,
|
27 |
output_dir: str,
|
28 |
) -> Presentation:
|
@@ -46,16 +47,16 @@ def generate_presentation(
|
|
46 |
presentation.slide_width = Inches(16)
|
47 |
|
48 |
pbar = tqdm.tqdm(total=4, desc="Presentation goes brrr...")
|
49 |
-
|
50 |
pbar.set_description("Generating titles for presentation")
|
51 |
-
titles = llm_generate_titles(llm_generate, description, prompt_config)
|
52 |
pbar.update(1)
|
53 |
-
|
54 |
pbar.set_description("Generating text for slides")
|
55 |
texts = [None] + llm_generate_text(
|
56 |
llm_generate,
|
57 |
-
description,
|
58 |
-
titles,
|
59 |
prompt_config
|
60 |
)
|
61 |
pbar.update(1)
|
|
|
23 |
generate_image: Callable[[str, int, int], Image.Image],
|
24 |
prompt_config: PromptConfig,
|
25 |
description: str,
|
26 |
+
slides_num: int,
|
27 |
font:Font,
|
28 |
output_dir: str,
|
29 |
) -> Presentation:
|
|
|
47 |
presentation.slide_width = Inches(16)
|
48 |
|
49 |
pbar = tqdm.tqdm(total=4, desc="Presentation goes brrr...")
|
50 |
+
|
51 |
pbar.set_description("Generating titles for presentation")
|
52 |
+
titles = llm_generate_titles(llm_generate, description + f", {slides_num} slides", prompt_config)
|
53 |
pbar.update(1)
|
54 |
+
|
55 |
pbar.set_description("Generating text for slides")
|
56 |
texts = [None] + llm_generate_text(
|
57 |
llm_generate,
|
58 |
+
description + f", {slides_num} slides",
|
59 |
+
titles[:slides_num],
|
60 |
prompt_config
|
61 |
)
|
62 |
pbar.update(1)
|