Update pipeline.py
Browse files- pipeline.py +3 -3
pipeline.py
CHANGED
@@ -25,14 +25,14 @@ class PreTrainedPipeline():
|
|
25 |
output_ids = self.model.generate(pixel_values, **self.gen_kwargs).sequences
|
26 |
return output_ids
|
27 |
|
|
|
|
|
28 |
# compile the model
|
29 |
image_path = os.path.join(path, 'val_000000039769.jpg')
|
30 |
image = Image.open(image_path)
|
31 |
self(image)
|
32 |
image.close()
|
33 |
-
|
34 |
-
self.generate = _generate
|
35 |
-
|
36 |
def __call__(self, inputs: "Image.Image") -> List[str]:
|
37 |
"""
|
38 |
Args:
|
|
|
25 |
output_ids = self.model.generate(pixel_values, **self.gen_kwargs).sequences
|
26 |
return output_ids
|
27 |
|
28 |
+
self.generate = _generate
|
29 |
+
|
30 |
# compile the model
|
31 |
image_path = os.path.join(path, 'val_000000039769.jpg')
|
32 |
image = Image.open(image_path)
|
33 |
self(image)
|
34 |
image.close()
|
35 |
+
|
|
|
|
|
36 |
def __call__(self, inputs: "Image.Image") -> List[str]:
|
37 |
"""
|
38 |
Args:
|