Spaces:
Runtime error
Runtime error
Commit
·
62b6c1b
1
Parent(s):
29dc431
formatting
Browse files
app.py
CHANGED
@@ -13,18 +13,16 @@ model = AutoModelForImageClassification.from_pretrained(chk_point)
|
|
13 |
|
14 |
try:
|
15 |
pipe = pipeline(
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
20 |
except NotImplementedError:
|
21 |
from transformers import pipeline
|
22 |
-
|
23 |
-
"image-classification",
|
24 |
-
|
25 |
-
device=device
|
26 |
-
)
|
27 |
-
|
28 |
|
29 |
def make_label_folders():
|
30 |
folders = model.config.label2id.keys()
|
|
|
13 |
|
14 |
try:
|
15 |
pipe = pipeline(
|
16 |
+
"image-classification",
|
17 |
+
chk_point,
|
18 |
+
accelerator="bettertransformer",
|
19 |
+
device=device,
|
20 |
+
)
|
21 |
except NotImplementedError:
|
22 |
from transformers import pipeline
|
23 |
+
|
24 |
+
pipe = pipeline("image-classification", chk_point, device=device)
|
25 |
+
|
|
|
|
|
|
|
26 |
|
27 |
def make_label_folders():
|
28 |
folders = model.config.label2id.keys()
|