Munaf1987 commited on
Commit
5ff26f2
Β·
verified Β·
1 Parent(s): fe8b3a0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -9
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 a download URL 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
- # For Hugging Face Spaces, create a download info block
218
- # Note: Replace 'your-username' and 'your-space-name' with your actual Space info
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 πŸ”— Space URL: https://huggingface.co/spaces/your-username/your-space-name"
223
- download_info += f"\n πŸ’‘ To download: Return this file as a Gradio output component"
224
 
225
  return download_info
226
 
227
  except Exception as e:
228
- print(f"⚠️ Failed to create download URL: {e}")
229
- return f"πŸ“ File saved: {file_path}"
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"""