Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files323 unmodified lines324325326327328329330331332327328329330323 unmodified lines )
if __name__ == "__main__": # For CPU execution, model loading might take time or fail if not handled. # The `if torch.cuda.is_available():` block handles model loading for GPU. # A CPU fallback for inference would require a CPU-compatible model or different handling in `generate`. # The provided code primarily targets GPU. # Added a basic placeholder image generation in `generate` if pipes are not loaded. # Also need `ImageDraw` for that.
from PIL import ImageDraw # Add ImageDraw import for CPU placeholder
demo.queue(max_size=20).launch(ssr_mode=True, show_error=True, share=True)app.py+1-6