Spaces:
Sleeping
Sleeping
Commit ·
cec4326
1
Parent(s): b7463dc
Add @spaces.GPU decorator for Hugging Face ZeroGPU compatibility
Browse files10 unmodified lines1112131415161710 unmodified linesfrom PIL import Imagefrom model import predict_flower, CATEGORIES, FLOWER_DETAILSdef classify_flower(image):if image is None:return "Please upload an image.", {}, ""10 unmodified lines1112131415161718192021222324252627282910 unmodified linesfrom PIL import Imagefrom model import predict_flower, CATEGORIES, FLOWER_DETAILS# Hugging Face ZeroGPU decorator supporttry:import spacesexcept ImportError:class DummySpaces:def GPU(self, fn=None, duration=60):if fn is None:return lambda f: freturn fnspaces = DummySpaces()@spaces.GPUdef classify_flower(image):if image is None:return "Please upload an image.", {}, ""
gradio_app.py+13-1