Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -236,36 +236,13 @@ def generate_ppt(file, topic, slide_length, api_key):
|
|
| 236 |
return f"./{name_}.pptx"
|
| 237 |
|
| 238 |
|
| 239 |
-
# with gr.Blocks(title="ChatGPT PPT框架生成") as demo:
|
| 240 |
-
# gr.Markdown("""<h1><center>ChatGPT PPT框架生成</center></h1>""")
|
| 241 |
-
# with gr.Row():
|
| 242 |
-
# with gr.Column():
|
| 243 |
-
# openai_token = gr.Textbox(label="OpenAI API Key")
|
| 244 |
-
# topic = gr.Textbox(label="PPT的主题或内容")
|
| 245 |
-
# length = gr.Slider(minimum=1, maximum=20, value=6, label="生成的PPT页数", step=1)
|
| 246 |
-
# theme = gr.File(value="./theme.pptx", file_types=['pptx', 'ppt'], label="PPT模版")
|
| 247 |
-
# output_file = gr.File(interactive=False)
|
| 248 |
-
|
| 249 |
-
# topic.submit(
|
| 250 |
-
# fn=generate_ppt,
|
| 251 |
-
# inputs=[theme, topic, length, openai_token],
|
| 252 |
-
# outputs=[output_file]
|
| 253 |
-
# )
|
| 254 |
-
|
| 255 |
-
# submit = gr.Button("生成")
|
| 256 |
-
# submit.click(
|
| 257 |
-
# fn=generate_ppt,
|
| 258 |
-
# inputs=[theme, topic, length, openai_token],
|
| 259 |
-
# outputs=[output_file]
|
| 260 |
-
# )
|
| 261 |
-
|
| 262 |
with gr.Blocks(title="AI Generated Presentation") as demo:
|
| 263 |
gr.Markdown("""<h1><center>AI Generated Presentation</center></h1>""")
|
| 264 |
with gr. Row():
|
| 265 |
with gr. Column():
|
| 266 |
openai_token = gr. Textbox(label="OpenAI API Key", type='password')
|
| 267 |
topic = gr.Textbox(label="Topic of the presentation")
|
| 268 |
-
length = gr.Slider(minimum=1, maximum=
|
| 269 |
theme = gr.File(value="./theme.pptx", file_types=['pptx', 'ppt'], label="PPT template")
|
| 270 |
output_file = gr. File(interactive=False)
|
| 271 |
|
|
|
|
| 236 |
return f"./{name_}.pptx"
|
| 237 |
|
| 238 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 239 |
with gr.Blocks(title="AI Generated Presentation") as demo:
|
| 240 |
gr.Markdown("""<h1><center>AI Generated Presentation</center></h1>""")
|
| 241 |
with gr. Row():
|
| 242 |
with gr. Column():
|
| 243 |
openai_token = gr. Textbox(label="OpenAI API Key", type='password')
|
| 244 |
topic = gr.Textbox(label="Topic of the presentation")
|
| 245 |
+
length = gr.Slider(minimum=1, maximum=50, value=6, label="number of generated PPT pages", step=1)
|
| 246 |
theme = gr.File(value="./theme.pptx", file_types=['pptx', 'ppt'], label="PPT template")
|
| 247 |
output_file = gr. File(interactive=False)
|
| 248 |
|