Image-to-Text
Transformers
PyTorch
Safetensors
English
git
image-text-to-text
vision
image-captioning
Instructions to use alexgk/git-large-coco with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use alexgk/git-large-coco with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "image-to-text" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("image-to-text", model="alexgk/git-large-coco")# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("alexgk/git-large-coco") model = AutoModelForImageTextToText.from_pretrained("alexgk/git-large-coco") - Notebooks
- Google Colab
- Kaggle
Update handler.py
Browse files- handler.py +1 -1
handler.py
CHANGED
|
@@ -7,7 +7,7 @@ import base64
|
|
| 7 |
|
| 8 |
class EndpointHandler():
|
| 9 |
def __init__(self, path=""):
|
| 10 |
-
self.pipeline=pipeline("
|
| 11 |
|
| 12 |
def __call__(self, data: Dict[str, Any]) -> str:
|
| 13 |
"""
|
|
|
|
| 7 |
|
| 8 |
class EndpointHandler():
|
| 9 |
def __init__(self, path=""):
|
| 10 |
+
self.pipeline=pipeline("image-to-text",model=path)
|
| 11 |
|
| 12 |
def __call__(self, data: Dict[str, Any]) -> str:
|
| 13 |
"""
|