Spaces:
Runtime error
Runtime error
add image_size_coef to gr.Interface and generate_presentation function
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ from src.font import Font
|
|
| 10 |
logs_dir = "logs"
|
| 11 |
fonts_dir = "fonts"
|
| 12 |
|
| 13 |
-
def create_presentation(description: str, slides_num: int, language: str, num_inference_steps: int
|
| 14 |
# Select the appropriate prompt configuration based on the selected language
|
| 15 |
if language == "English":
|
| 16 |
prompt_config = en_gigachat_config
|
|
@@ -34,7 +34,8 @@ def create_presentation(description: str, slides_num: int, language: str, num_in
|
|
| 34 |
slides_num=slides_num,
|
| 35 |
font=font,
|
| 36 |
output_dir=output_dir,
|
| 37 |
-
num_inference_steps=num_inference_steps
|
|
|
|
| 38 |
)
|
| 39 |
|
| 40 |
filename = f'{output_dir}/presentation.pptx'
|
|
@@ -96,25 +97,14 @@ iface = gr.Interface(
|
|
| 96 |
maximum=50,
|
| 97 |
step=1,
|
| 98 |
value=50,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
)
|
| 100 |
-
########
|
| 101 |
-
# gr.Slider(
|
| 102 |
-
# label="width of the slide image",
|
| 103 |
-
# minimum=256,
|
| 104 |
-
# maximum=MAX_IMAGE_SIZE,
|
| 105 |
-
# step=32,
|
| 106 |
-
# value=1024, #Replace with defaults that work for your model
|
| 107 |
-
# )
|
| 108 |
-
|
| 109 |
-
# gr.Slider(
|
| 110 |
-
# label="height of the slide image",
|
| 111 |
-
# minimum=256,
|
| 112 |
-
# maximum=MAX_IMAGE_SIZE,
|
| 113 |
-
# step=32,
|
| 114 |
-
# value=1024, #Replace with defaults that work for your model
|
| 115 |
-
# )
|
| 116 |
-
|
| 117 |
-
|
| 118 |
],
|
| 119 |
outputs=gr.File(
|
| 120 |
label="Download Presentation"
|
|
|
|
| 10 |
logs_dir = "logs"
|
| 11 |
fonts_dir = "fonts"
|
| 12 |
|
| 13 |
+
def create_presentation(description: str, slides_num: int, language: str, num_inference_steps: int, image_size_coef: float):
|
| 14 |
# Select the appropriate prompt configuration based on the selected language
|
| 15 |
if language == "English":
|
| 16 |
prompt_config = en_gigachat_config
|
|
|
|
| 34 |
slides_num=slides_num,
|
| 35 |
font=font,
|
| 36 |
output_dir=output_dir,
|
| 37 |
+
num_inference_steps=num_inference_steps,
|
| 38 |
+
image_size_coef=image_size_coef
|
| 39 |
)
|
| 40 |
|
| 41 |
filename = f'{output_dir}/presentation.pptx'
|
|
|
|
| 97 |
maximum=50,
|
| 98 |
step=1,
|
| 99 |
value=50,
|
| 100 |
+
),
|
| 101 |
+
gr.Slider(
|
| 102 |
+
label="scaling factor for image reduction",
|
| 103 |
+
minimum=0.25,
|
| 104 |
+
maximum=1.0,
|
| 105 |
+
step=0.05,
|
| 106 |
+
value=1.0,
|
| 107 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
],
|
| 109 |
outputs=gr.File(
|
| 110 |
label="Download Presentation"
|