Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -33,14 +33,25 @@ def read_readme():
|
|
33 |
INSTRUCTION_TEMPLATES = {
|
34 |
################# PODCAST ##################
|
35 |
"podcast": {
|
36 |
-
"intro": """Your task is to
|
|
|
|
|
37 |
""",
|
38 |
"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.",
|
39 |
-
"scratch_pad": """
|
|
|
|
|
|
|
|
|
|
|
40 |
""",
|
41 |
-
"prelude": """
|
42 |
""",
|
43 |
-
"dialog": """
|
|
|
|
|
|
|
|
|
44 |
""",
|
45 |
},
|
46 |
################# MATERIAL DISCOVERY SUMMARY ##################
|
@@ -568,7 +579,7 @@ with gr.Blocks(title="PDF to Audio", css="""
|
|
568 |
with gr.Column(scale=1):
|
569 |
gr.HTML('''
|
570 |
<div id="logo_container">
|
571 |
-
<img src="https://
|
572 |
</div>
|
573 |
''')
|
574 |
#gr.Markdown("")
|
@@ -743,4 +754,4 @@ demo.queue(max_size=20, default_concurrency_limit=32)
|
|
743 |
|
744 |
# Launch the Gradio app
|
745 |
if __name__ == "__main__":
|
746 |
-
demo.launch()
|
|
|
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 |
+
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.
|
38 |
+
Define all terms used carefully for a broad audience of listeners.
|
39 |
""",
|
40 |
"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.",
|
41 |
+
"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.
|
42 |
+
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.
|
43 |
+
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.
|
44 |
+
Define all terms used clearly and spend effort to explain the background.
|
45 |
+
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.
|
46 |
+
Make sure to make it fun and exciting.
|
47 |
""",
|
48 |
+
"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.
|
49 |
""",
|
50 |
+
"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.
|
51 |
+
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.
|
52 |
+
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.
|
53 |
+
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.
|
54 |
+
The podcast should have around 20000 words.
|
55 |
""",
|
56 |
},
|
57 |
################# MATERIAL DISCOVERY SUMMARY ##################
|
|
|
579 |
with gr.Column(scale=1):
|
580 |
gr.HTML('''
|
581 |
<div id="logo_container">
|
582 |
+
<img src="https://huggingface.co/spaces/lamm-mit/PDF2Audio/resolve/main/logo.png" id="logo_image" alt="Logo">
|
583 |
</div>
|
584 |
''')
|
585 |
#gr.Markdown("")
|
|
|
754 |
|
755 |
# Launch the Gradio app
|
756 |
if __name__ == "__main__":
|
757 |
+
demo.launch()
|