Fix docs and docstrings Omdet-Turbo (#33726)

Fix weights path in docs
This commit is contained in:
Yoni Gozlan
2024-09-26 12:18:23 -04:00
committed by GitHub
parent c716fc0e48
commit 77b47e6645
3 changed files with 6 additions and 6 deletions

View File

@@ -49,8 +49,8 @@ from PIL import Image
from transformers import AutoProcessor, OmDetTurboForObjectDetection from transformers import AutoProcessor, OmDetTurboForObjectDetection
processor = AutoProcessor.from_pretrained("omlab/omdet-turbo-tiny") processor = AutoProcessor.from_pretrained("omlab/omdet-turbo-swin-tiny-hf")
model = OmDetTurboForObjectDetection.from_pretrained("omlab/omdet-turbo-tiny") model = OmDetTurboForObjectDetection.from_pretrained("omlab/omdet-turbo-swin-tiny-hf")
url = "http://images.cocodataset.org/val2017/000000039769.jpg" url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw) image = Image.open(requests.get(url, stream=True).raw)

View File

@@ -134,10 +134,10 @@ class OmDetTurboConfig(PretrainedConfig):
```python ```python
>>> from transformers import OmDetTurboConfig, OmDetTurboForObjectDetection >>> from transformers import OmDetTurboConfig, OmDetTurboForObjectDetection
>>> # Initializing a OmDet-Turbo omlab/omdet-turbo-tiny style configuration >>> # Initializing a OmDet-Turbo omlab/omdet-turbo-swin-tiny-hf style configuration
>>> configuration = OmDetTurboConfig() >>> configuration = OmDetTurboConfig()
>>> # Initializing a model (with random weights) from the omlab/omdet-turbo-tiny style configuration >>> # Initializing a model (with random weights) from the omlab/omdet-turbo-swin-tiny-hf style configuration
>>> model = OmDetTurboForObjectDetection(configuration) >>> model = OmDetTurboForObjectDetection(configuration)
>>> # Accessing the model configuration >>> # Accessing the model configuration

View File

@@ -1709,8 +1709,8 @@ class OmDetTurboForObjectDetection(OmDetTurboPreTrainedModel):
>>> from transformers import AutoProcessor, OmDetTurboForObjectDetection >>> from transformers import AutoProcessor, OmDetTurboForObjectDetection
>>> processor = AutoProcessor.from_pretrained("omlab/omdet-turbo-tiny") >>> processor = AutoProcessor.from_pretrained("omlab/omdet-turbo-swin-tiny-hf")
>>> model = OmDetTurboForObjectDetection.from_pretrained("omlab/omdet-turbo-tiny") >>> model = OmDetTurboForObjectDetection.from_pretrained("omlab/omdet-turbo-swin-tiny-hf")
>>> url = "http://images.cocodataset.org/val2017/000000039769.jpg" >>> url = "http://images.cocodataset.org/val2017/000000039769.jpg"
>>> image = Image.open(requests.get(url, stream=True).raw) >>> image = Image.open(requests.get(url, stream=True).raw)