Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -41,8 +41,10 @@ def generate_podcast_script(api_key, prompt, uploaded_file, duration, num_hosts)
|
|
| 41 |
file_content = uploaded_file.read().decode('utf-8')
|
| 42 |
combined_content += "\n" + file_content if combined_content else file_content
|
| 43 |
|
|
|
|
|
|
|
| 44 |
prompt = f"""
|
| 45 |
-
Create a podcast script for {'
|
| 46 |
{combined_content}
|
| 47 |
|
| 48 |
Duration: {duration} minutes. Include natural speech, humor, and occasional off-topic thoughts.
|
|
@@ -56,6 +58,7 @@ def generate_podcast_script(api_key, prompt, uploaded_file, duration, num_hosts)
|
|
| 56 |
Example: "I can't believe I stayed up all night <yawn> only to find out the meeting was canceled <groan>."
|
| 57 |
|
| 58 |
Ensure content flows naturally and stays on topic. Match the script length to {duration} minutes.
|
|
|
|
| 59 |
"""
|
| 60 |
|
| 61 |
response = model.generate_content(prompt)
|
|
|
|
| 41 |
file_content = uploaded_file.read().decode('utf-8')
|
| 42 |
combined_content += "\n" + file_content if combined_content else file_content
|
| 43 |
|
| 44 |
+
num_hosts = int(num_hosts) # Convert to integer
|
| 45 |
+
|
| 46 |
prompt = f"""
|
| 47 |
+
Create a podcast script for {num_hosts} {'person' if num_hosts == 1 else 'people'} discussing:
|
| 48 |
{combined_content}
|
| 49 |
|
| 50 |
Duration: {duration} minutes. Include natural speech, humor, and occasional off-topic thoughts.
|
|
|
|
| 58 |
Example: "I can't believe I stayed up all night <yawn> only to find out the meeting was canceled <groan>."
|
| 59 |
|
| 60 |
Ensure content flows naturally and stays on topic. Match the script length to {duration} minutes.
|
| 61 |
+
{'Make sure the script is a monologue for one person.' if num_hosts == 1 else 'Ensure the dialogue alternates between two distinct voices.'}
|
| 62 |
"""
|
| 63 |
|
| 64 |
response = model.generate_content(prompt)
|