Spaces:
Runtime error
Runtime error
Commit
•
905a09b
1
Parent(s):
f458c5a
make batchable
Browse files- service.py +1 -2
service.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
import bentoml
|
2 |
-
|
3 |
from bentoml.io import Image, JSON
|
4 |
from transformers import pipeline
|
5 |
|
@@ -12,7 +11,7 @@ class PretrainedModelRunnable(bentoml.Runnable):
|
|
12 |
self.unmasker = pipeline('object-detection', model="davanstrien/detr-resnet-50_fine_tuned_nls_chapbooks",
|
13 |
feature_extractor="davanstrien/detr-resnet-50_fine_tuned_nls_chapbooks")
|
14 |
|
15 |
-
@bentoml.Runnable.method(batchable=
|
16 |
def __call__(self, input_text):
|
17 |
return self.unmasker(input_text)
|
18 |
|
|
|
1 |
import bentoml
|
|
|
2 |
from bentoml.io import Image, JSON
|
3 |
from transformers import pipeline
|
4 |
|
|
|
11 |
self.unmasker = pipeline('object-detection', model="davanstrien/detr-resnet-50_fine_tuned_nls_chapbooks",
|
12 |
feature_extractor="davanstrien/detr-resnet-50_fine_tuned_nls_chapbooks")
|
13 |
|
14 |
+
@bentoml.Runnable.method(batchable=True)
|
15 |
def __call__(self, input_text):
|
16 |
return self.unmasker(input_text)
|
17 |
|