Spaces:
Runtime error
Runtime error
Ramkumar commited on
Update app.py
Browse files73 unmodified lines747576777879809 unmodified lines9091929394959673 unmodified linesreturn tamil_text, f"An error occurred during translation: {str(e)}", Noneelif input_text: # No audio input, so use text inputtranslation = input_text# Generate chatbot response9 unmodified linesif generate_image_flag: # Generate image if the checkbox is checkedimage = generate_image(translation)return tamil_text, chatbot_response, image # Return both chatbot response and image (if generated)# Custom CSS for improved styling and centered titlecss = """73 unmodified lines7475767778798081828384859 unmodified lines959697989910010173 unmodified linesreturn tamil_text, f"An error occurred during translation: {str(e)}", Noneelif input_text: # No audio input, so use text inputtry:translator = GoogleTranslator(source='ta', target='en')translation = translator.translate(input_text)except Exception as e:return tamil_text, f"An error occurred during translation: {str(e)}", None# translation = input_text# Generate chatbot response9 unmodified linesif generate_image_flag: # Generate image if the checkbox is checkedimage = generate_image(translation)return translation, chatbot_response, image # Return both chatbot response and image (if generated)# Custom CSS for improved styling and centered titlecss = """
app.py+7-2