mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-01 18:51:14 +06:00
fixed shape issue for T5 tracing (#11742)
Co-authored-by: Michael Benayoun <michael@huggingface.co>
This commit is contained in:
parent
0fc56df5fb
commit
a0531c8a24
@ -68,6 +68,8 @@ class HFProxy(Proxy):
|
|||||||
if self.tracer.num_choices <= 0:
|
if self.tracer.num_choices <= 0:
|
||||||
raise ValueError("num_choices must be given to the CustomTracer for MultipleChoice tasks.")
|
raise ValueError("num_choices must be given to the CustomTracer for MultipleChoice tasks.")
|
||||||
shape = shape[:1] + [self.tracer.num_choices] + shape[1:]
|
shape = shape[:1] + [self.tracer.num_choices] + shape[1:]
|
||||||
|
elif "hidden_states.s" in code_context:
|
||||||
|
shape = shape + [self.tracer.root.config.hidden_size]
|
||||||
else:
|
else:
|
||||||
# Default case:
|
# Default case:
|
||||||
# - If self.size is called for an unpacking, retrieves the corresponding unpacking
|
# - If self.size is called for an unpacking, retrieves the corresponding unpacking
|
||||||
|
Loading…
Reference in New Issue
Block a user