Instructions to use Drazcat-AI/categories_peru with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Drazcat-AI/categories_peru with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="Drazcat-AI/categories_peru") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Drazcat-AI/categories_peru", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update handler.py
Browse files- handler.py +2 -2
handler.py
CHANGED
|
@@ -83,8 +83,8 @@ class EndpointHandler():
|
|
| 83 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
| 84 |
model_filename = "vit_multiclass_model_best/model.safetensors"
|
| 85 |
local_path = hf_hub_download(repo_id="Drazcat-AI/categories_peru", filename=model_filename)
|
| 86 |
-
hf_hub_download(repo_id="Drazcat-AI/categories_peru", filename='class_info.json')
|
| 87 |
-
hf_hub_download(repo_id="Drazcat-AI/categories_peru", filename='processor_config.json')
|
| 88 |
print('MODEL PATH:',local_path)
|
| 89 |
self.model, self.image_processor, self.class_info, self.device = load_model_and_config(local_path)
|
| 90 |
|
|
|
|
| 83 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
| 84 |
model_filename = "vit_multiclass_model_best/model.safetensors"
|
| 85 |
local_path = hf_hub_download(repo_id="Drazcat-AI/categories_peru", filename=model_filename)
|
| 86 |
+
hf_hub_download(repo_id="Drazcat-AI/categories_peru", filename='vit_multiclass_model_best/class_info.json')
|
| 87 |
+
hf_hub_download(repo_id="Drazcat-AI/categories_peru", filename='vit_multiclass_model_best/processor_config.json')
|
| 88 |
print('MODEL PATH:',local_path)
|
| 89 |
self.model, self.image_processor, self.class_info, self.device = load_model_and_config(local_path)
|
| 90 |
|