bluenevus commited on
Commit
b83a237
·
verified ·
1 Parent(s): 35d26f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -38,10 +38,12 @@ def generate_podcast_script(api_key, prompt, uploaded_file, duration, num_hosts)
38
  try:
39
  genai.configure(api_key=api_key)
40
  model = genai.GenerativeModel('gemini-2.5-pro-preview-03-25')
41
-
42
  combined_content = prompt or ""
43
- if uploaded_file:
44
- file_content = uploaded_file.read().decode('utf-8')
 
 
45
  combined_content += "\n" + file_content if combined_content else file_content
46
 
47
  num_hosts = int(num_hosts) # Convert to integer
 
38
  try:
39
  genai.configure(api_key=api_key)
40
  model = genai.GenerativeModel('gemini-2.5-pro-preview-03-25')
41
+
42
  combined_content = prompt or ""
43
+
44
+ if uploaded_file is not None:
45
+ # Handle the uploaded file content
46
+ file_content = uploaded_file.name # This gets the content of the NamedString
47
  combined_content += "\n" + file_content if combined_content else file_content
48
 
49
  num_hosts = int(num_hosts) # Convert to integer