Instructions to use immanuelpeter/Muse-Glimmer-Vision with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use immanuelpeter/Muse-Glimmer-Vision with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-feature-extraction", model="immanuelpeter/Muse-Glimmer-Vision")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("immanuelpeter/Muse-Glimmer-Vision") model = AutoModel.from_pretrained("immanuelpeter/Muse-Glimmer-Vision", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Sync card, example, and manifest with GitHub main
Browse files- examples/inference.py +3 -3
examples/inference.py
CHANGED
|
@@ -1,13 +1,13 @@
|
|
| 1 |
import argparse
|
| 2 |
from pathlib import Path
|
| 3 |
-
import
|
| 4 |
|
| 5 |
from PIL import Image
|
| 6 |
import torch
|
| 7 |
from transformers import AutoImageProcessor, AutoModel
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
| 11 |
|
| 12 |
|
| 13 |
MODEL_ID = "immanuelpeter/Muse-Glimmer-Vision"
|
|
|
|
| 1 |
import argparse
|
| 2 |
from pathlib import Path
|
| 3 |
+
import runpy
|
| 4 |
|
| 5 |
from PIL import Image
|
| 6 |
import torch
|
| 7 |
from transformers import AutoImageProcessor, AutoModel
|
| 8 |
|
| 9 |
+
BUNDLE = Path(__file__).absolute().parents[1]
|
| 10 |
+
load_projector = runpy.run_path(str(BUNDLE / "projector.py"))["load_projector"]
|
| 11 |
|
| 12 |
|
| 13 |
MODEL_ID = "immanuelpeter/Muse-Glimmer-Vision"
|