Fabrice-TIERCELIN commited on
Commit
9a2b8db
·
verified ·
1 Parent(s): 6a8e08a

import spaces only on HuggingFace

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -3,7 +3,10 @@ import json
3
  import torch
4
  import time
5
  import random
6
- import spaces
 
 
 
7
 
8
  from tqdm import tqdm
9
  from huggingface_hub import snapshot_download
 
3
  import torch
4
  import time
5
  import random
6
+ try:
7
+ # Only on HuggingFace
8
+ import spaces
9
+ except ImportError:
10
 
11
  from tqdm import tqdm
12
  from huggingface_hub import snapshot_download