mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 10:12:23 +06:00
[bark] fix loading of generation config (#36587)
This commit is contained in:
parent
0440dbc0e1
commit
c1b24c0b73
@ -1573,6 +1573,14 @@ class BarkModel(BarkPreTrainedModel):
|
||||
|
||||
self.config = config
|
||||
|
||||
@classmethod
|
||||
def can_generate(cls) -> bool:
|
||||
# Bark has a unique model structure, where the external class (`BarkModel`) doesn't need to inherit from
|
||||
# `GenerationMixin` (it has a non-standard generation method), but one of the internal models do
|
||||
# (`BarkSemanticModel`). This means that the base `can_generate()` will return `False`, but we need to
|
||||
# override it so as to do `GenerationConfig` handling in multiple parts of the codebase.
|
||||
return True
|
||||
|
||||
@property
|
||||
def device(self) -> torch.device:
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user