ikraamkb commited on
Commit
6d798ab
·
verified ·
1 Parent(s): 5a9078a

Update appImage.py

Browse files
Files changed (1) hide show
  1. appImage.py +5 -7
appImage.py CHANGED
@@ -82,15 +82,14 @@ def create_pdf(content: dict, original_filename: str) -> str:
82
  print(f"PDF creation error: {e}")
83
  return ""
84
 
85
- def process_image(file, enable_tts: bool):
86
  """Handle image processing for Gradio interface"""
87
- if file is None:
88
  return "Please upload an image first", "Ready", None, None
89
 
90
- file_path = file.name
91
- original_filename = os.path.basename(file_path)
92
-
93
  try:
 
 
94
  # Analyze image
95
  result = analyze_image(file_path)
96
  if "error" in result:
@@ -168,5 +167,4 @@ app = gr.mount_gradio_app(app, demo, path="/")
168
 
169
  @app.get("/")
170
  def redirect_to_interface():
171
- return RedirectResponse(url="/")
172
-
 
82
  print(f"PDF creation error: {e}")
83
  return ""
84
 
85
+ def process_image(file_path: str, enable_tts: bool):
86
  """Handle image processing for Gradio interface"""
87
+ if not file_path:
88
  return "Please upload an image first", "Ready", None, None
89
 
 
 
 
90
  try:
91
+ original_filename = os.path.basename(file_path)
92
+
93
  # Analyze image
94
  result = analyze_image(file_path)
95
  if "error" in result:
 
167
 
168
  @app.get("/")
169
  def redirect_to_interface():
170
+ return RedirectResponse(url="/")