Spaces:
Running
Running
Martin Tomov
commited on
Commit
β’
a1873d6
1
Parent(s):
21336df
spaces cuda fix
Browse files
app.py
CHANGED
@@ -1,3 +1,6 @@
|
|
|
|
|
|
|
|
1 |
try:
|
2 |
import detectron2
|
3 |
except ImportError:
|
@@ -18,8 +21,6 @@ except ImportError:
|
|
18 |
os.system('pip install transformers')
|
19 |
os.system('pip install git+https://github.com/IDEA-Research/Grounded-Segment-Anything.git')
|
20 |
|
21 |
-
import os
|
22 |
-
import spaces
|
23 |
import gradio as gr
|
24 |
import json
|
25 |
import numpy as np
|
|
|
1 |
+
import os
|
2 |
+
import spaces # on top as CUDA needs to be initialized after `spaces`
|
3 |
+
|
4 |
try:
|
5 |
import detectron2
|
6 |
except ImportError:
|
|
|
21 |
os.system('pip install transformers')
|
22 |
os.system('pip install git+https://github.com/IDEA-Research/Grounded-Segment-Anything.git')
|
23 |
|
|
|
|
|
24 |
import gradio as gr
|
25 |
import json
|
26 |
import numpy as np
|