Error measuring embedding size for some DPR models (#573)

Fixes an error unpacking a tuple that contains a single element.
This commit is contained in:
David Kyle 2023-09-19 10:44:15 +01:00 committed by GitHub
parent 5c5ef63a69
commit 301cda8d69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -729,7 +729,7 @@ class TransformerModel:
else:
sample_embedding = self._traceable_model.sample_output()
if type(sample_embedding) is tuple:
text_embedding, _ = sample_embedding
text_embedding = sample_embedding[0]
else:
text_embedding = sample_embedding