Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -222,7 +222,7 @@ class PodcastGenerator:
|
|
| 222 |
line = sentence + "." if not sentence.endswith('.') else sentence
|
| 223 |
podcast_lines.append({
|
| 224 |
"speaker": speaker,
|
| 225 |
-
"line":
|
| 226 |
})
|
| 227 |
|
| 228 |
result = {
|
|
@@ -251,13 +251,13 @@ class PodcastGenerator:
|
|
| 251 |
if len(extracted_text) > 2000:
|
| 252 |
extracted_text = extracted_text[:2000] + "..."
|
| 253 |
add_log("✂️ Text truncated to 2000 characters")
|
| 254 |
-
prompt = f"Create a podcast discussion about this content: {extracted_text}"
|
| 255 |
elif file_obj.endswith('.txt'):
|
| 256 |
with open(file_obj, 'r', encoding='utf-8') as f:
|
| 257 |
file_content = f.read()
|
| 258 |
if len(file_content) > 2000:
|
| 259 |
file_content = file_content[:2000] + "..."
|
| 260 |
-
prompt = f"Create a podcast discussion about this content: {file_content}"
|
| 261 |
|
| 262 |
except Exception as e:
|
| 263 |
add_log(f"⚠️ File processing error: {e}")
|
|
|
|
| 222 |
line = sentence + "." if not sentence.endswith('.') else sentence
|
| 223 |
podcast_lines.append({
|
| 224 |
"speaker": speaker,
|
| 225 |
+
"line": linepro
|
| 226 |
})
|
| 227 |
|
| 228 |
result = {
|
|
|
|
| 251 |
if len(extracted_text) > 2000:
|
| 252 |
extracted_text = extracted_text[:2000] + "..."
|
| 253 |
add_log("✂️ Text truncated to 2000 characters")
|
| 254 |
+
prompt = f"Create a professional podcast discussion, where two experts discuss about this content: {extracted_text}"
|
| 255 |
elif file_obj.endswith('.txt'):
|
| 256 |
with open(file_obj, 'r', encoding='utf-8') as f:
|
| 257 |
file_content = f.read()
|
| 258 |
if len(file_content) > 2000:
|
| 259 |
file_content = file_content[:2000] + "..."
|
| 260 |
+
prompt = f"Create a professional podcast discussion, where two experts discuss about this content: {file_content}"
|
| 261 |
|
| 262 |
except Exception as e:
|
| 263 |
add_log(f"⚠️ File processing error: {e}")
|