Spaces:
Paused
Paused
Commit
·
dd2d897
1
Parent(s):
77f454d
tentative fix
Browse files- OmniAvatar/models/wav2vec.py +12 -2
OmniAvatar/models/wav2vec.py
CHANGED
@@ -65,7 +65,12 @@ class Wav2VecModel(Wav2Vec2Model):
|
|
65 |
Returns:
|
66 |
The output of the Wav2Vec model.
|
67 |
"""
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
output_hidden_states = (
|
71 |
output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
|
@@ -153,7 +158,12 @@ class Wav2VecModel(Wav2Vec2Model):
|
|
153 |
Returns:
|
154 |
The encoded output features.
|
155 |
"""
|
156 |
-
|
|
|
|
|
|
|
|
|
|
|
157 |
|
158 |
output_hidden_states = (
|
159 |
output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
|
|
|
65 |
Returns:
|
66 |
The output of the Wav2Vec model.
|
67 |
"""
|
68 |
+
# Set attention implementation to 'eager' when output_attentions is requested
|
69 |
+
if output_attentions or (output_attentions is None and getattr(self.config, 'output_attentions', False)):
|
70 |
+
self.config._attn_implementation = 'eager'
|
71 |
+
output_attentions = True
|
72 |
+
else:
|
73 |
+
output_attentions = False
|
74 |
|
75 |
output_hidden_states = (
|
76 |
output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
|
|
|
158 |
Returns:
|
159 |
The encoded output features.
|
160 |
"""
|
161 |
+
# Set attention implementation to 'eager' when output_attentions is requested
|
162 |
+
if output_attentions or (output_attentions is None and getattr(self.config, 'output_attentions', False)):
|
163 |
+
self.config._attn_implementation = 'eager'
|
164 |
+
output_attentions = True
|
165 |
+
else:
|
166 |
+
output_attentions = False
|
167 |
|
168 |
output_hidden_states = (
|
169 |
output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
|