Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -209,24 +209,22 @@ class ProfessionalCartoonFilmGenerator:
|
|
| 209 |
return " ".join(words[:50])
|
| 210 |
|
| 211 |
def create_download_url(self, file_path: str, file_type: str = "file") -> str:
|
| 212 |
-
"""Create
|
| 213 |
try:
|
| 214 |
file_name = os.path.basename(file_path)
|
| 215 |
file_size = os.path.getsize(file_path) / (1024*1024)
|
| 216 |
|
| 217 |
-
#
|
| 218 |
-
|
| 219 |
-
download_info = f"π₯ Download {file_type}: {file_name}"
|
| 220 |
-
download_info += f"\n π Local path: {file_path}"
|
| 221 |
download_info += f"\n π File size: {file_size:.1f} MB"
|
| 222 |
-
download_info += f"\n
|
| 223 |
-
download_info += f"\n
|
| 224 |
|
| 225 |
return download_info
|
| 226 |
|
| 227 |
except Exception as e:
|
| 228 |
-
print(f"β οΈ Failed to create download
|
| 229 |
-
return f"π File
|
| 230 |
|
| 231 |
def generate_professional_script(self, user_input: str) -> Dict[str, Any]:
|
| 232 |
"""Generate a professional cartoon script with detailed character development"""
|
|
|
|
| 209 |
return " ".join(words[:50])
|
| 210 |
|
| 211 |
def create_download_url(self, file_path: str, file_type: str = "file") -> str:
|
| 212 |
+
"""Create download info for generated content"""
|
| 213 |
try:
|
| 214 |
file_name = os.path.basename(file_path)
|
| 215 |
file_size = os.path.getsize(file_path) / (1024*1024)
|
| 216 |
|
| 217 |
+
# Note: Temp files cannot be accessed via direct URLs in Hugging Face Spaces
|
| 218 |
+
download_info = f"π₯ Generated {file_type}: {file_name}"
|
|
|
|
|
|
|
| 219 |
download_info += f"\n π File size: {file_size:.1f} MB"
|
| 220 |
+
download_info += f"\n β οΈ Note: Use Gradio File output component to download"
|
| 221 |
+
download_info += f"\n π Internal path: {file_path}"
|
| 222 |
|
| 223 |
return download_info
|
| 224 |
|
| 225 |
except Exception as e:
|
| 226 |
+
print(f"β οΈ Failed to create download info: {e}")
|
| 227 |
+
return f"π File generated: {file_path}"
|
| 228 |
|
| 229 |
def generate_professional_script(self, user_input: str) -> Dict[str, Any]:
|
| 230 |
"""Generate a professional cartoon script with detailed character development"""
|