victorgg commited on
Commit
852ed6c
·
verified ·
1 Parent(s): 8cdfe03

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -17
app.py CHANGED
@@ -180,20 +180,10 @@ with gr.Blocks() as demo:
180
  inputs=[image_input, prompt_input, gemini_api_key],
181
  outputs=output_gallery,
182
  )
183
-
184
- # --- Test Code ---
185
- # Create a dummy image (replace with your actual image if needed)
186
- dummy_image = Image.new("RGBA", (100, 100), color="red")
187
- dummy_prompt = "Make the image blue"
188
- dummy_api_key = os.environ.get("GEMINI_API_KEY") # Or put a placeholder key here for testing
189
-
190
- # Call the function directly
191
- logger.info("Calling process_image_and_prompt directly...")
192
- result = process_image_and_prompt(dummy_image, dummy_prompt, dummy_api_key)
193
-
194
- if result:
195
- logger.info(f"Direct call successful. Result: {result}")
196
- # result[0].show() # Uncomment to display image if running locally
197
- else:
198
- logger.error("Direct call failed.")
199
-
 
180
  inputs=[image_input, prompt_input, gemini_api_key],
181
  outputs=output_gallery,
182
  )
183
+
184
+ try:
185
+ demo.launch(share=True)
186
+ except Exception as e:
187
+ logger.error(f"Failed to launch Gradio app: {e}")
188
+ print(f"Failed to launch Gradio app: {e}") #Print for debuging in console.
189
+