Instructions to use not-lain/MyRepo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use not-lain/MyRepo with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="not-lain/MyRepo", trust_remote_code=True) pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoModelForImageClassification model = AutoModelForImageClassification.from_pretrained("not-lain/MyRepo", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
| tags: | |
| - custom_code | |
| # how to create custom architectures | |
| you can read this [blogpost](https://huggingface.co/blog/not-lain/custom-architectures-with-huggingface) to find out more 📖 | |
| # How to use | |
| you can the model via the command | |
| ```python | |
| from transformers import AutoModelForImageClassification | |
| model = AutoModelForImageClassification.from_pretrained("not-lain/MyRepo", trust_remote_code=True) | |
| ``` | |
| or you can use the pipeline | |
| ```python | |
| from transformers import pipeline | |
| pipe = pipeline(model="not-lain/MyRepo", trust_remote_code=True) | |
| pipe( | |
| "url", | |
| download=True, # will call the download_img method | |
| clean_output=False # will be passed as postprocess_kwargs | |
| ) | |
| ``` | |
| # parameters | |
| the pipeline supports the following parameters : | |
| * download | |
| * clean_output | |
| you can also use the following method to download images from the web | |
| ```python | |
| pipe.download_img(url) | |
| ``` | |