Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -275,13 +275,13 @@ class PodcastGenerator:
|
|
| 275 |
if len(extracted_text) > 2000:
|
| 276 |
extracted_text = extracted_text[:2000] + "..."
|
| 277 |
add_log("✂️ Text truncated to 2000 characters")
|
| 278 |
-
prompt =
|
| 279 |
elif file_obj.endswith('.txt'):
|
| 280 |
with open(file_obj, 'r', encoding='utf-8') as f:
|
| 281 |
file_content = f.read()
|
| 282 |
if len(file_content) > 2000:
|
| 283 |
file_content = file_content[:2000] + "..."
|
| 284 |
-
prompt =
|
| 285 |
|
| 286 |
except Exception as e:
|
| 287 |
add_log(f"⚠️ File processing error: {e}")
|
|
@@ -320,7 +320,7 @@ Example JSON structure:
|
|
| 320 |
"""
|
| 321 |
user_prompt = f"\nTopic: {prompt}\nJSON:"
|
| 322 |
full_prompt = system_prompt + user_prompt
|
| 323 |
-
|
| 324 |
|
| 325 |
try:
|
| 326 |
if progress:
|
|
|
|
| 275 |
if len(extracted_text) > 2000:
|
| 276 |
extracted_text = extracted_text[:2000] + "..."
|
| 277 |
add_log("✂️ Text truncated to 2000 characters")
|
| 278 |
+
prompt = extracted_text
|
| 279 |
elif file_obj.endswith('.txt'):
|
| 280 |
with open(file_obj, 'r', encoding='utf-8') as f:
|
| 281 |
file_content = f.read()
|
| 282 |
if len(file_content) > 2000:
|
| 283 |
file_content = file_content[:2000] + "..."
|
| 284 |
+
prompt = file_content
|
| 285 |
|
| 286 |
except Exception as e:
|
| 287 |
add_log(f"⚠️ File processing error: {e}")
|
|
|
|
| 320 |
"""
|
| 321 |
user_prompt = f"\nTopic: {prompt}\nJSON:"
|
| 322 |
full_prompt = system_prompt + user_prompt
|
| 323 |
+
add_log("🔍 Prompt Preview:\n" + full_prompt[:1000])
|
| 324 |
|
| 325 |
try:
|
| 326 |
if progress:
|