Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -170,7 +170,7 @@ class PodcastGenerator:
|
|
| 170 |
error_msg = f"❌ PDF extraction failed: {str(e)}"
|
| 171 |
add_log(error_msg)
|
| 172 |
raise Exception(error_msg)
|
| 173 |
-
|
| 174 |
async def postprocess_conversation(self, raw_text: str) -> str:
|
| 175 |
"""Run LLM again to enforce strict Speaker 1/2 format"""
|
| 176 |
prompt = f"""
|
|
@@ -349,7 +349,7 @@ Now format the following:
|
|
| 349 |
add_log(f"✅ Fallback podcast created with {len(podcast_lines)} lines")
|
| 350 |
return result
|
| 351 |
|
| 352 |
-
|
| 353 |
async def generate_script(self, prompt: str, language: str, file_obj=None, progress=None) -> Dict:
|
| 354 |
"""Improved script generation with better error handling"""
|
| 355 |
if not model_loaded or not self.model or not self.tokenizer:
|
|
|
|
| 170 |
error_msg = f"❌ PDF extraction failed: {str(e)}"
|
| 171 |
add_log(error_msg)
|
| 172 |
raise Exception(error_msg)
|
| 173 |
+
|
| 174 |
async def postprocess_conversation(self, raw_text: str) -> str:
|
| 175 |
"""Run LLM again to enforce strict Speaker 1/2 format"""
|
| 176 |
prompt = f"""
|
|
|
|
| 349 |
add_log(f"✅ Fallback podcast created with {len(podcast_lines)} lines")
|
| 350 |
return result
|
| 351 |
|
| 352 |
+
|
| 353 |
async def generate_script(self, prompt: str, language: str, file_obj=None, progress=None) -> Dict:
|
| 354 |
"""Improved script generation with better error handling"""
|
| 355 |
if not model_loaded or not self.model or not self.tokenizer:
|