Pix2struct: doctest fix (#22761)

This commit is contained in:
Joao Gante 2023-04-14 09:40:39 +01:00 committed by GitHub
parent 390e121fb5
commit 66b15efb20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1700,8 +1700,8 @@ class Pix2StructForConditionalGeneration(Pix2StructPreTrainedModel):
>>> # forward pass
>>> outputs = model(**inputs, labels=labels)
>>> loss = outputs.loss
>>> print(loss.item())
5.239729881286621
>>> print(f"{loss.item():.5f}")
5.23973
```"""
use_cache = use_cache if use_cache is not None else self.config.text_config.use_cache
return_dict = return_dict if return_dict is not None else self.config.use_return_dict