Replies: 1 comment
-
Hey, @zh0613... In the meantime, if you need to explore this feature and make it work, you can downgrade Haystack: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When i run this code
teacher = FARMReader(model_name_or_path="my_model", use_gpu=True)
student = FARMReader(model_name_or_path="huawei-noah/TinyBERT_General_6L_768D", use_gpu=True)
student.distil_intermediate_layers_from(teacher, data_dir=".", train_filename="augmented_dataset.json", use_gpu=True)
student.distil_prediction_layer_from(teacher, data_dir="data/squad20", train_filename="dev-v2.0.json", use_gpu=True)
student.save(directory="my_distilled_model")`
This error pop out
RuntimeError Traceback (most recent call last)
in <cell line: 9>()
7
8 student.distil_intermediate_layers_from(teacher, data_dir=".", train_filename="augmented_dataset.json", use_gpu=True)
----> 9 student.distil_prediction_layer_from(teacher, data_dir="data/squad20", train_filename="dev-v2.0.json", use_gpu=True)
10
11 student.save(directory="my_distilled_model")
7 frames
/usr/local/lib/python3.10/dist-packages/haystack/modeling/data_handler/data_silo.py in (.0)
784 with torch.inference_mode():
785 batch_transposed = zip(*batch) # transpose dimensions (from batch, features, ... to features, batch, ...)
--> 786 batch_transposed_list = [torch.stack(b) for b in batch_transposed] # create tensors for each feature
787 batch_dict = {
788 key: tensor.to(self.device) for key, tensor in zip(tensor_names, batch_transposed_list)
RuntimeError: stack expects each tensor to be equal size, but got [5, 2] at entry 0 and [6, 2] at entry 2`
Beta Was this translation helpful? Give feedback.
All reactions