Spaces:
Build error
Build error
Update app.py
Browse files1 unmodified line23456796 unmodified lines1041051061071081091101111121131141 unmodified lineimport gradio as grfrom groq import Groqimport osfrom deep_translator import GoogleTranslatorfrom deep_translator import GoogleTranslator # Import the GoogleTranslator classimport whisper96 unmodified linesd.text((10, 150), "Image Generation Failed", fill=(255, 255, 255))return error_imgtry:image = Image.open(io.BytesIO(image_bytes))return imageexcept Exception as e:print(f"Error: {e}")error_img = Image.new('RGB', (300, 300), color=(255, 0, 0))d = ImageDraw.Draw(error_img)d.text((10, 150), "Invalid Image Data", fill=(255, 255, 255))1 unmodified line2345678996 unmodified lines1061071081091101111121131141151161171181191 unmodified lineimport gradio as grfrom groq import Groqimport osfrom PIL import Image, ImageDrawimport iofrom deep_translator import GoogleTranslatorfrom deep_translator import GoogleTranslator # Import the GoogleTranslator classimport whisper96 unmodified linesd.text((10, 150), "Image Generation Failed", fill=(255, 255, 255))return error_img# Debug: Check the type of image_bytesprint(f"Received image_bytes type: {type(image_bytes)}")try:image = Image.open(io.BytesIO(image_bytes))return imageexcept Exception as e:print(f"Error while opening image: {e}")error_img = Image.new('RGB', (300, 300), color=(255, 0, 0))d = ImageDraw.Draw(error_img)d.text((10, 150), "Invalid Image Data", fill=(255, 255, 255))
app.py+6-1