Spaces:
Runtime error
Runtime error
wondervictor
commited on
Commit
•
f06103e
1
Parent(s):
7dcb45e
add accelerate
Browse files- .DS_Store +0 -0
- app.py +4 -2
- assets/architecture.jpg +0 -0
- assets/bus.jpg +0 -0
- assets/bus_vis.png +0 -0
- assets/carrots.jpg +0 -0
- assets/carrots_vis.png +0 -0
- assets/food.jpg +0 -0
- assets/food_vis.png +0 -0
- assets/logo.jpg +0 -0
- assets/pizza.jpg +0 -0
- assets/pizza_vis.png +0 -0
- assets/zebra.jpg +0 -0
- assets/zebra_vis.png +0 -0
- requirements.txt +1 -1
.DS_Store
CHANGED
Binary files a/.DS_Store and b/.DS_Store differ
|
|
app.py
CHANGED
@@ -5,6 +5,7 @@ from transformers import AutoTokenizer
|
|
5 |
import torch
|
6 |
import numpy as np
|
7 |
import sys
|
|
|
8 |
|
9 |
version = "YxZhang/evf-sam"
|
10 |
model_type = "ori"
|
@@ -19,9 +20,10 @@ kwargs = {
|
|
19 |
"torch_dtype": torch.half,
|
20 |
}
|
21 |
model = EvfSamModel.from_pretrained(version, low_cpu_mem_usage=True,
|
22 |
-
**kwargs).
|
23 |
-
|
24 |
|
|
|
25 |
@torch.no_grad()
|
26 |
def pred(image_np, prompt):
|
27 |
original_size_list = [image_np.shape[:2]]
|
|
|
5 |
import torch
|
6 |
import numpy as np
|
7 |
import sys
|
8 |
+
import spaces
|
9 |
|
10 |
version = "YxZhang/evf-sam"
|
11 |
model_type = "ori"
|
|
|
20 |
"torch_dtype": torch.half,
|
21 |
}
|
22 |
model = EvfSamModel.from_pretrained(version, low_cpu_mem_usage=True,
|
23 |
+
**kwargs).eval()
|
24 |
+
model.to('cuda')
|
25 |
|
26 |
+
@spaces.GPU
|
27 |
@torch.no_grad()
|
28 |
def pred(image_np, prompt):
|
29 |
original_size_list = [image_np.shape[:2]]
|
assets/architecture.jpg
ADDED
assets/bus.jpg
ADDED
assets/bus_vis.png
ADDED
assets/carrots.jpg
ADDED
assets/carrots_vis.png
ADDED
assets/food.jpg
ADDED
assets/food_vis.png
ADDED
assets/logo.jpg
ADDED
assets/pizza.jpg
ADDED
assets/pizza_vis.png
ADDED
assets/zebra.jpg
ADDED
assets/zebra_vis.png
ADDED
requirements.txt
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
packaging
|
2 |
-
accelerate
|
3 |
sentencepiece
|
4 |
einops==0.4.1
|
5 |
fastapi==0.100.1
|
|
|
1 |
packaging
|
2 |
+
accelerate==0.25.0
|
3 |
sentencepiece
|
4 |
einops==0.4.1
|
5 |
fastapi==0.100.1
|