Instructions to use poolside-laguna-hackathon/laguna-vision with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use poolside-laguna-hackathon/laguna-vision 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="poolside-laguna-hackathon/laguna-vision")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("poolside-laguna-hackathon/laguna-vision", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Add Laguna Transformers config compatibility alias
Browse files
lagunavision/backbones/hf_causal.py
CHANGED
|
@@ -17,6 +17,16 @@ from lagunavision.train.batching import pad_visual_batch
|
|
| 17 |
|
| 18 |
def _install_huggingface_hub_dataclasses_shim() -> None:
|
| 19 |
"""Provide compatibility for Laguna remote code on HF Endpoint runtimes."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
try:
|
| 21 |
import huggingface_hub.dataclasses # noqa: F401
|
| 22 |
|
|
|
|
| 17 |
|
| 18 |
def _install_huggingface_hub_dataclasses_shim() -> None:
|
| 19 |
"""Provide compatibility for Laguna remote code on HF Endpoint runtimes."""
|
| 20 |
+
try:
|
| 21 |
+
import transformers.configuration_utils as configuration_utils
|
| 22 |
+
|
| 23 |
+
if not hasattr(configuration_utils, "PreTrainedConfig") and hasattr(
|
| 24 |
+
configuration_utils, "PretrainedConfig"
|
| 25 |
+
):
|
| 26 |
+
configuration_utils.PreTrainedConfig = configuration_utils.PretrainedConfig
|
| 27 |
+
except ImportError:
|
| 28 |
+
pass
|
| 29 |
+
|
| 30 |
try:
|
| 31 |
import huggingface_hub.dataclasses # noqa: F401
|
| 32 |
|