mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
more fixes?
This commit is contained in:
parent
e2973440d1
commit
0c9f6de0fd
@ -359,7 +359,7 @@ class JanusVisionAttention(nn.Module):
|
||||
|
||||
output = self.projection_layer(attn_output)
|
||||
output = self.projection_dropout(output)
|
||||
return output
|
||||
return output, attn_weights
|
||||
|
||||
|
||||
class JanusVisionMLP(nn.Module):
|
||||
|
@ -529,7 +529,7 @@ class JanusVisionAttention(nn.Module):
|
||||
|
||||
output = self.projection_layer(attn_output)
|
||||
output = self.projection_dropout(output)
|
||||
return output
|
||||
return output, attn_weights
|
||||
|
||||
|
||||
class JanusVisionMLP(nn.Module):
|
||||
|
@ -952,10 +952,7 @@ def can_return_tuple(func):
|
||||
@wraps(func)
|
||||
def wrapper(self, *args, **kwargs):
|
||||
return_dict = self.config.use_return_dict if hasattr(self, "config") else True
|
||||
if "return_dict" in kwargs:
|
||||
return_dict = kwargs.get("return_dict", self.config.use_return_dict)
|
||||
if "return_dict" in kwargs:
|
||||
kwargs["return_dict"] = True
|
||||
return_dict = kwargs.pop("return_dict", self.config.use_return_dict)
|
||||
output = func(self, *args, **kwargs)
|
||||
|
||||
if "return_dict" in kwargs and return_dict is False:
|
||||
|
Loading…
Reference in New Issue
Block a user