tiffank1802 commited on
Commit
be6c30d
·
1 Parent(s): 420aa0c

Make celery import conditional in __init__.py

Browse files
Files changed (1) hide show
  1. simulationserver/__init__.py +8 -2
simulationserver/__init__.py CHANGED
@@ -1,3 +1,9 @@
1
- from .celery import app as celery_app
2
 
3
- __all__ = ('celery_app',)
 
 
 
 
 
 
 
1
+ import os
2
 
3
+ HF_SPACES = os.environ.get('HF_SPACES', '').lower() in ('true', '1', 'yes')
4
+
5
+ if not HF_SPACES:
6
+ from .celery import app as celery_app
7
+ __all__ = ('celery_app',)
8
+ else:
9
+ __all__ = ()