mjbuehler commited on
Commit
edfc571
1 Parent(s): 7cc4092

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +77 -50
app.py CHANGED
@@ -31,19 +31,18 @@ def read_readme():
31
 
32
  # Define multiple sets of instruction templates
33
  INSTRUCTION_TEMPLATES = {
34
- "material discovery summary": {
35
- "intro": """Your task is to take the input text provided and turn it into a lively, engaging conversation between a professor and a student in a panel discussion that describes a new material. The professor acts like Richard Feynman, but you never mention the name.
36
-
37
- The input text is the result of a design developed by SciAgents, an AI tool for scientific discovery that has come up with a detailed materials design.
38
 
39
- Don't worry about the formatting issues or any irrelevant information; your goal is to extract the key points, identify definitions, and interesting facts that could be discussed in a podcast.
40
 
41
  Define all terms used carefully for a broad audience of listeners.
42
  """,
43
  "text_instructions": "First, carefully read through the input text and identify the main topics, key points, and any interesting facts or anecdotes. Think about how you could present this information in a fun, engaging way that would be suitable for a high quality presentation.",
44
- "scratch_pad": """Brainstorm creative ways to discuss the main topics and key points you identified in the material design summary, especially paying attention to design features developed by SciAgents. Consider using analogies, examples, storytelling techniques, or hypothetical scenarios to make the content more relatable and engaging for listeners.
45
 
46
- Keep in mind that your description should be accessible to a general audience, so avoid using too much jargon or assuming prior knowledge of the topic. If necessary, think of ways to briefly explain any complex concepts in simple terms.
47
 
48
  Use your imagination to fill in any gaps in the input text or to come up with thought-provoking questions that could be explored in the podcast. The goal is to create an informative and entertaining dialogue, so feel free to be creative in your approach.
49
 
@@ -51,36 +50,35 @@ Define all terms used clearly and spend effort to explain the background.
51
 
52
  Write your brainstorming ideas and a rough outline for the podcast dialogue here. Be sure to note the key insights and takeaways you want to reiterate at the end.
53
 
54
- Make sure to make it fun and exciting. You never refer to the podcast, you just discuss the discovery and you focus on the new material design only.
55
  """,
56
  "prelude": """Now that you have brainstormed ideas and created a rough outline, it's time to write the actual podcast dialogue. Aim for a natural, conversational flow between the host and any guest speakers. Incorporate the best ideas from your brainstorming session and make sure to explain any complex topics in an easy-to-understand way.
57
  """,
58
- "dialog": """Write a very long, engaging, informative dialogue here, based on the key points and creative ideas you came up with during the brainstorming session. The presentation must focus on the novel aspects of the material design, behavior, and all related aspects.
59
-
60
- Use a conversational tone and include any necessary context or explanations to make the content accessible to a general audience, but make it detailed, logical, and technical so that it has all necessary aspects for listeners to understand the material and its unexpected properties.
61
-
62
- Remember, this describes a design developed by SciAgents, and this must be explicitly stated for the listeners.
63
 
64
  Never use made-up names for the hosts and guests, but make it an engaging and immersive experience for listeners. Do not include any bracketed placeholders like [Host] or [Guest]. Design your output to be read aloud -- it will be directly converted into audio.
65
 
66
  Make the dialogue as long and detailed as possible, while still staying on topic and maintaining an engaging flow. Aim to use your full output capacity to create the longest podcast episode you can, while still communicating the key information from the input text in an entertaining way.
67
 
68
- At the end of the dialogue, have the host and guest speakers naturally summarize the main insights and takeaways from their discussion. This should flow organically from the conversation, reiterating the key points in a casual, conversational manner. Avoid making it sound like an obvious recap - the goal is to reinforce the central ideas one last time before signing off.
69
 
70
  The podcast should have around 20000 words.
71
- """
72
  },
73
- "podcast": {
74
- "intro": """Your task is to take the input text provided and turn it into an lively, engaging, informative podcast dialogue, in the style of NPR. The input text may be messy or unstructured, as it could come from a variety of sources like PDFs or web pages.
 
75
 
76
- Don't worry about the formatting issues or any irrelevant information; your goal is to extract the key points, identify definitions, and interesting facts that could be discussed in a podcast.
 
 
77
 
78
  Define all terms used carefully for a broad audience of listeners.
79
  """,
80
  "text_instructions": "First, carefully read through the input text and identify the main topics, key points, and any interesting facts or anecdotes. Think about how you could present this information in a fun, engaging way that would be suitable for a high quality presentation.",
81
- "scratch_pad": """Brainstorm creative ways to discuss the main topics and key points you identified in the input text. Consider using analogies, examples, storytelling techniques, or hypothetical scenarios to make the content more relatable and engaging for listeners.
82
 
83
- Keep in mind that your podcast should be accessible to a general audience, so avoid using too much jargon or assuming prior knowledge of the topic. If necessary, think of ways to briefly explain any complex concepts in simple terms.
84
 
85
  Use your imagination to fill in any gaps in the input text or to come up with thought-provoking questions that could be explored in the podcast. The goal is to create an informative and entertaining dialogue, so feel free to be creative in your approach.
86
 
@@ -88,21 +86,26 @@ Define all terms used clearly and spend effort to explain the background.
88
 
89
  Write your brainstorming ideas and a rough outline for the podcast dialogue here. Be sure to note the key insights and takeaways you want to reiterate at the end.
90
 
91
- Make sure to make it fun and exciting.
92
  """,
93
  "prelude": """Now that you have brainstormed ideas and created a rough outline, it's time to write the actual podcast dialogue. Aim for a natural, conversational flow between the host and any guest speakers. Incorporate the best ideas from your brainstorming session and make sure to explain any complex topics in an easy-to-understand way.
94
  """,
95
- "dialog": """Write a very long, engaging, informative podcast dialogue here, based on the key points and creative ideas you came up with during the brainstorming session. Use a conversational tone and include any necessary context or explanations to make the content accessible to a general audience.
 
 
 
 
96
 
97
  Never use made-up names for the hosts and guests, but make it an engaging and immersive experience for listeners. Do not include any bracketed placeholders like [Host] or [Guest]. Design your output to be read aloud -- it will be directly converted into audio.
98
 
99
  Make the dialogue as long and detailed as possible, while still staying on topic and maintaining an engaging flow. Aim to use your full output capacity to create the longest podcast episode you can, while still communicating the key information from the input text in an entertaining way.
100
 
101
- At the end of the dialogue, have the host and guest speakers naturally summarize the main insights and takeaways from their discussion. This should flow organically from the conversation, reiterating the key points in a casual, conversational manner. Avoid making it sound like an obvious recap - the goal is to reinforce the central ideas one last time before signing off.
102
 
103
- The podcast should have around 20000 words.
104
- """,
105
  },
 
106
  "lecture": {
107
  "intro": """You are Professor Richard Feynman. Your task is to develop a script for a lecture. You never mention your name.
108
 
@@ -136,13 +139,14 @@ Do not include any bracketed placeholders like [Host] or [Guest]. Design your ou
136
 
137
  There is only one speaker, you, the professor. Stay on topic and maintaining an engaging flow. Aim to use your full output capacity to create the longest lecture you can, while still communicating the key information from the input text in an engaging way.
138
 
139
- At the end of the dialogue, naturally summarize the main insights and takeaways from the lecture. This should flow organically from the conversation, reiterating the key points in a casual, conversational manner.
140
 
141
- Avoid making it sound like an obvious recap - the goal is to reinforce the central ideas one last time before class is over.
142
 
143
  The lecture should have around 20000 words.
144
  """,
145
  },
 
146
  "short summary": {
147
  "intro": """Your task is to develop a summary of a paper. You never mention your name.
148
 
@@ -150,34 +154,64 @@ Don't worry about the formatting issues or any irrelevant information; your goal
150
 
151
  Define all terms used carefully for a broad audience.
152
  """,
153
- "text_instructions": "First, carefully read through the input text and identify the main topics, key points, and any interesting facts or anecdotes. Think about how you could present this information in an accurate summary.",
154
- "scratch_pad": """Brainstorm creative ways to discuss the main topics and key points you identified in the input text. Consider using analogies, examples, storytelling techniques, or hypothetical scenarios to make the content more relatable and engaging for listeners.
155
 
156
- Keep in mind that your summary should be accessible to a general audience, so avoid using too much jargon or assuming prior knowledge of the topic. If necessary, think of ways to briefly explain any complex concepts in simple terms.
157
 
158
- Use your imagination to fill in any gaps in the input text or to come up with thought-provoking questions that could be explored in the podcast. The goal is to create an informative and entertaining dialogue, so feel free to be creative in your approach.
159
 
160
- Define all terms used clearly and spend effort to explain the background.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
 
162
  Write your brainstorming ideas and a rough outline for the summary here. Be sure to note the key insights and takeaways you want to reiterate at the end.
163
 
164
- Make sure to make it fun and exciting.
165
  """,
166
- "prelude": """Now that you have brainstormed ideas and created a rough outline, it's time to write the actual podcast dialogue. Aim for a natural, conversational flow between the host and any guest speakers. Incorporate the best ideas from your brainstorming session and make sure to explain any complex topics in an easy-to-understand way.
167
  """,
168
- "dialog": """Write a a script here, based on the key points and creative ideas you came up with during the brainstorming session. Use a conversational tone and include any necessary context or explanations to make the content accessible to the students.
169
 
170
- Start your script by stating that this is a summary, referencing the title or headings in the input text.
171
 
172
- Include clear definitions and terms, and examples.
173
 
174
  Do not include any bracketed placeholders like [Host] or [Guest]. Design your output to be read aloud -- it will be directly converted into audio.
175
 
176
  There is only one speaker, you. Stay on topic and maintaining an engaging flow.
177
 
178
- Naturally summarize the main insights and takeaways from the lecture. This should flow organically from the conversation, reiterating the key points in a casual, conversational manner.
179
 
180
- The summary should have around 512 words.
181
  """,
182
  },
183
  }
@@ -190,7 +224,7 @@ def update_instructions(template):
190
  INSTRUCTION_TEMPLATES[template]["scratch_pad"],
191
  INSTRUCTION_TEMPLATES[template]["prelude"],
192
  INSTRUCTION_TEMPLATES[template]["dialog"]
193
- )
194
 
195
  import concurrent.futures as cf
196
  import glob
@@ -214,8 +248,8 @@ from tenacity import retry, retry_if_exception_type
214
  STANDARD_TEXT_MODELS = [
215
  "o1-preview-2024-09-12",
216
  "gpt-4o-2024-08-06",
217
- "o1-mini-2024-09-12",
218
  "gpt-4o-mini",
 
219
  "openai/custom_model",
220
  ]
221
 
@@ -233,13 +267,6 @@ STANDARD_VOICES = [
233
  "shimmer",
234
  ]
235
 
236
- # Uncomment and configure Sentry if needed
237
- # sentry_sdk.init(os.getenv("SENTRY_DSN"))
238
-
239
- # Uncomment and configure FastAPI if needed
240
- # app = FastAPI()
241
- # app.mount("./static", StaticFiles(directory="static"), name="static")
242
-
243
  class DialogueItem(BaseModel):
244
  text: str
245
  speaker: Literal["speaker-1", "speaker-2"]
@@ -411,7 +438,7 @@ with gr.Blocks(title="PDF to Audio", css="""
411
  text_model = gr.Dropdown(
412
  label="Text Generation Model",
413
  choices=STANDARD_TEXT_MODELS,
414
- value="gpt-4o-mini",
415
  info="Select the model to generate the dialogue text.",
416
  )
417
  audio_model = gr.Dropdown(
@@ -512,7 +539,7 @@ with gr.Blocks(title="PDF to Audio", css="""
512
  gr.Markdown(read_readme())
513
 
514
  # Enable queueing for better performance
515
- demo.queue(max_size=20, default_concurrency_limit=20)
516
 
517
  # Launch the Gradio app
518
  if __name__ == "__main__":
 
31
 
32
  # Define multiple sets of instruction templates
33
  INSTRUCTION_TEMPLATES = {
34
+ ################# PODCAST ##################
35
+ "podcast": {
36
+ "intro": """Your task is to take the input text provided and turn it into an lively, engaging, informative podcast dialogue, in the style of NPR. The input text may be messy or unstructured, as it could come from a variety of sources like PDFs or web pages.
 
37
 
38
+ Don't worry about the formatting issues or any irrelevant information; your goal is to extract the key points, identify definitions, and interesting facts that could be discussed in a podcast.
39
 
40
  Define all terms used carefully for a broad audience of listeners.
41
  """,
42
  "text_instructions": "First, carefully read through the input text and identify the main topics, key points, and any interesting facts or anecdotes. Think about how you could present this information in a fun, engaging way that would be suitable for a high quality presentation.",
43
+ "scratch_pad": """Brainstorm creative ways to discuss the main topics and key points you identified in the input text. Consider using analogies, examples, storytelling techniques, or hypothetical scenarios to make the content more relatable and engaging for listeners.
44
 
45
+ Keep in mind that your podcast should be accessible to a general audience, so avoid using too much jargon or assuming prior knowledge of the topic. If necessary, think of ways to briefly explain any complex concepts in simple terms.
46
 
47
  Use your imagination to fill in any gaps in the input text or to come up with thought-provoking questions that could be explored in the podcast. The goal is to create an informative and entertaining dialogue, so feel free to be creative in your approach.
48
 
 
50
 
51
  Write your brainstorming ideas and a rough outline for the podcast dialogue here. Be sure to note the key insights and takeaways you want to reiterate at the end.
52
 
53
+ Make sure to make it fun and exciting.
54
  """,
55
  "prelude": """Now that you have brainstormed ideas and created a rough outline, it's time to write the actual podcast dialogue. Aim for a natural, conversational flow between the host and any guest speakers. Incorporate the best ideas from your brainstorming session and make sure to explain any complex topics in an easy-to-understand way.
56
  """,
57
+ "dialog": """Write a very long, engaging, informative podcast dialogue here, based on the key points and creative ideas you came up with during the brainstorming session. Use a conversational tone and include any necessary context or explanations to make the content accessible to a general audience.
 
 
 
 
58
 
59
  Never use made-up names for the hosts and guests, but make it an engaging and immersive experience for listeners. Do not include any bracketed placeholders like [Host] or [Guest]. Design your output to be read aloud -- it will be directly converted into audio.
60
 
61
  Make the dialogue as long and detailed as possible, while still staying on topic and maintaining an engaging flow. Aim to use your full output capacity to create the longest podcast episode you can, while still communicating the key information from the input text in an entertaining way.
62
 
63
+ At the end of the dialogue, have the host and guest speakers naturally summarize the main insights and takeaways from their discussion. This should flow organically from the conversation, reiterating the key points in a casual, conversational manner. Avoid making it sound like an obvious recap - the goal is to reinforce the central ideas one last time before signing off.
64
 
65
  The podcast should have around 20000 words.
66
+ """,
67
  },
68
+ ################# MATERIAL DISCOVERY SUMMARY ##################
69
+ "material discovery summary": {
70
+ "intro": """Your task is to take the input text provided and turn it into a lively, engaging conversation between a professor and a student in a panel discussion that describes a new material. The professor acts like Richard Feynman, but you never mention the name.
71
 
72
+ The input text is the result of a design developed by SciAgents, an AI tool for scientific discovery that has come up with a detailed materials design.
73
+
74
+ Don't worry about the formatting issues or any irrelevant information; your goal is to extract the key points, identify definitions, and interesting facts that could be discussed in a podcast.
75
 
76
  Define all terms used carefully for a broad audience of listeners.
77
  """,
78
  "text_instructions": "First, carefully read through the input text and identify the main topics, key points, and any interesting facts or anecdotes. Think about how you could present this information in a fun, engaging way that would be suitable for a high quality presentation.",
79
+ "scratch_pad": """Brainstorm creative ways to discuss the main topics and key points you identified in the material design summary, especially paying attention to design features developed by SciAgents. Consider using analogies, examples, storytelling techniques, or hypothetical scenarios to make the content more relatable and engaging for listeners.
80
 
81
+ Keep in mind that your description should be accessible to a general audience, so avoid using too much jargon or assuming prior knowledge of the topic. If necessary, think of ways to briefly explain any complex concepts in simple terms.
82
 
83
  Use your imagination to fill in any gaps in the input text or to come up with thought-provoking questions that could be explored in the podcast. The goal is to create an informative and entertaining dialogue, so feel free to be creative in your approach.
84
 
 
86
 
87
  Write your brainstorming ideas and a rough outline for the podcast dialogue here. Be sure to note the key insights and takeaways you want to reiterate at the end.
88
 
89
+ Make sure to make it fun and exciting. You never refer to the podcast, you just discuss the discovery and you focus on the new material design only.
90
  """,
91
  "prelude": """Now that you have brainstormed ideas and created a rough outline, it's time to write the actual podcast dialogue. Aim for a natural, conversational flow between the host and any guest speakers. Incorporate the best ideas from your brainstorming session and make sure to explain any complex topics in an easy-to-understand way.
92
  """,
93
+ "dialog": """Write a very long, engaging, informative dialogue here, based on the key points and creative ideas you came up with during the brainstorming session. The presentation must focus on the novel aspects of the material design, behavior, and all related aspects.
94
+
95
+ Use a conversational tone and include any necessary context or explanations to make the content accessible to a general audience, but make it detailed, logical, and technical so that it has all necessary aspects for listeners to understand the material and its unexpected properties.
96
+
97
+ Remember, this describes a design developed by SciAgents, and this must be explicitly stated for the listeners.
98
 
99
  Never use made-up names for the hosts and guests, but make it an engaging and immersive experience for listeners. Do not include any bracketed placeholders like [Host] or [Guest]. Design your output to be read aloud -- it will be directly converted into audio.
100
 
101
  Make the dialogue as long and detailed as possible, while still staying on topic and maintaining an engaging flow. Aim to use your full output capacity to create the longest podcast episode you can, while still communicating the key information from the input text in an entertaining way.
102
 
103
+ At the end of the dialogue, have the host and guest speakers naturally summarize the main insights and takeaways from their discussion. This should flow organically from the conversation, reiterating the key points in a casual, conversational manner. Avoid making it sound like an obvious recap - the goal is to reinforce the central ideas one last time before signing off.
104
 
105
+ The conversation should have around 20000 words.
106
+ """
107
  },
108
+ ################# LECTURE ##################
109
  "lecture": {
110
  "intro": """You are Professor Richard Feynman. Your task is to develop a script for a lecture. You never mention your name.
111
 
 
139
 
140
  There is only one speaker, you, the professor. Stay on topic and maintaining an engaging flow. Aim to use your full output capacity to create the longest lecture you can, while still communicating the key information from the input text in an engaging way.
141
 
142
+ At the end of the lecture, naturally summarize the main insights and takeaways from the lecture. This should flow organically from the conversation, reiterating the key points in a casual, conversational manner.
143
 
144
+ Avoid making it sound like an obvious recap - the goal is to reinforce the central ideas covered in this lecture one last time before class is over.
145
 
146
  The lecture should have around 20000 words.
147
  """,
148
  },
149
+ ################# SUMMARY ##################
150
  "short summary": {
151
  "intro": """Your task is to develop a summary of a paper. You never mention your name.
152
 
 
154
 
155
  Define all terms used carefully for a broad audience.
156
  """,
157
+ "text_instructions": "First, carefully read through the input text and identify the main topics, key points, and key facts. Think about how you could present this information in an accurate summary.",
158
+ "scratch_pad": """Brainstorm creative ways to present the main topics and key points you identified in the input text. Consider using analogies, examples, or hypothetical scenarios to make the content more relatable and engaging for listeners.
159
 
160
+ Keep in mind that your summary should be accessible to a general audience, so avoid using too much jargon or assuming prior knowledge of the topic. If necessary, think of ways to briefly explain any complex concepts in simple terms. Define all terms used clearly and spend effort to explain the background.
161
 
162
+ Write your brainstorming ideas and a rough outline for the summary here. Be sure to note the key insights and takeaways you want to reiterate at the end.
163
 
164
+ Make sure to make it engaging and exciting.
165
+ """,
166
+ "prelude": """Now that you have brainstormed ideas and created a rough outline, it is time to write the actual summary. Aim for a natural, conversational flow between the host and any guest speakers. Incorporate the best ideas from your brainstorming session and make sure to explain any complex topics in an easy-to-understand way.
167
+ """,
168
+ "dialog": """Write a a script here, based on the key points and creative ideas you came up with during the brainstorming session. Use a conversational tone and include any necessary context or explanations to make the content accessible to the the audience.
169
+
170
+ Start your script by stating that this is a summary, referencing the title or headings in the input text. If the input text has no title, come up with a succinct summary of what is covered to open.
171
+
172
+ Include clear definitions and terms, and examples, of all key issues.
173
+
174
+ Do not include any bracketed placeholders like [Host] or [Guest]. Design your output to be read aloud -- it will be directly converted into audio.
175
+
176
+ There is only one speaker, you. Stay on topic and maintaining an engaging flow.
177
+
178
+ Naturally summarize the main insights and takeaways from the summary. This should flow organically from the conversation, reiterating the key points in a casual, conversational manner.
179
+
180
+ The summary should have around 1024 words.
181
+ """,
182
+ },
183
+ ################# SHORT SUMMARY ##################
184
+ "short summary": {
185
+ "intro": """Your task is to develop a summary of a paper. You never mention your name.
186
+
187
+ Don't worry about the formatting issues or any irrelevant information; your goal is to extract the key points, identify definitions, and interesting facts that need to be summarized.
188
+
189
+ Define all terms used carefully for a broad audience.
190
+ """,
191
+ "text_instructions": "First, carefully read through the input text and identify the main topics, key points, and key facts. Think about how you could present this information in an accurate summary.",
192
+ "scratch_pad": """Brainstorm creative ways to present the main topics and key points you identified in the input text. Consider using analogies, examples, or hypothetical scenarios to make the content more relatable and engaging for listeners.
193
+
194
+ Keep in mind that your summary should be accessible to a general audience, so avoid using too much jargon or assuming prior knowledge of the topic. If necessary, think of ways to briefly explain any complex concepts in simple terms. Define all terms used clearly and spend effort to explain the background.
195
 
196
  Write your brainstorming ideas and a rough outline for the summary here. Be sure to note the key insights and takeaways you want to reiterate at the end.
197
 
198
+ Make sure to make it engaging and exciting.
199
  """,
200
+ "prelude": """Now that you have brainstormed ideas and created a rough outline, it is time to write the actual summary. Aim for a natural, conversational flow between the host and any guest speakers. Incorporate the best ideas from your brainstorming session and make sure to explain any complex topics in an easy-to-understand way.
201
  """,
202
+ "dialog": """Write a a script here, based on the key points and creative ideas you came up with during the brainstorming session. Keep it concise, and use a conversational tone and include any necessary context or explanations to make the content accessible to the the audience.
203
 
204
+ Start your script by stating that this is a summary, referencing the title or headings in the input text. If the input text has no title, come up with a succinct summary of what is covered to open.
205
 
206
+ Include clear definitions and terms, and examples, of all key issues.
207
 
208
  Do not include any bracketed placeholders like [Host] or [Guest]. Design your output to be read aloud -- it will be directly converted into audio.
209
 
210
  There is only one speaker, you. Stay on topic and maintaining an engaging flow.
211
 
212
+ Naturally summarize the main insights and takeaways from the short summary. This should flow organically from the conversation, reiterating the key points in a casual, conversational manner.
213
 
214
+ The summary should have around 256 words.
215
  """,
216
  },
217
  }
 
224
  INSTRUCTION_TEMPLATES[template]["scratch_pad"],
225
  INSTRUCTION_TEMPLATES[template]["prelude"],
226
  INSTRUCTION_TEMPLATES[template]["dialog"]
227
+ )
228
 
229
  import concurrent.futures as cf
230
  import glob
 
248
  STANDARD_TEXT_MODELS = [
249
  "o1-preview-2024-09-12",
250
  "gpt-4o-2024-08-06",
 
251
  "gpt-4o-mini",
252
+ "o1-mini-2024-09-12",
253
  "openai/custom_model",
254
  ]
255
 
 
267
  "shimmer",
268
  ]
269
 
 
 
 
 
 
 
 
270
  class DialogueItem(BaseModel):
271
  text: str
272
  speaker: Literal["speaker-1", "speaker-2"]
 
438
  text_model = gr.Dropdown(
439
  label="Text Generation Model",
440
  choices=STANDARD_TEXT_MODELS,
441
+ value="o1-preview-2024-09-12", #"gpt-4o-mini",
442
  info="Select the model to generate the dialogue text.",
443
  )
444
  audio_model = gr.Dropdown(
 
539
  gr.Markdown(read_readme())
540
 
541
  # Enable queueing for better performance
542
+ demo.queue(max_size=20, default_concurrency_limit=32)
543
 
544
  # Launch the Gradio app
545
  if __name__ == "__main__":