bright-hub-66 / utils.py
AiCoderv2's picture
Deploy Gradio app with multiple files
ed4033a verified
raw
history blame contribute delete
318 Bytes
# Utility functions for the text-to-image generator
def validate_prompt(prompt):
"""Basic prompt validation"""
if not prompt or len(prompt.strip()) == 0:
return False, "Prompt cannot be empty"
if len(prompt) > 500:
return False, "Prompt is too long (max 500 characters)"
return True, ""