Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: identify_dynamic_embeddings does not work for DataPair #3614

Open
MattGPT-ai opened this issue Feb 7, 2025 · 0 comments
Open

[Bug]: identify_dynamic_embeddings does not work for DataPair #3614

MattGPT-ai opened this issue Feb 7, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@MattGPT-ai
Copy link
Contributor

Describe the bug

The training util identify_dynamic_embeddings does not look properly at the embeddings for the first and second. It probably makes more sense to have a member function for each DataPoint class, instead of checking isinstance within an external function. There could still be an outer function that iterates over data points in a batch, but it should itself call identify_dynamic_embeddings_point for each data point it iterates over. I would say that identify_dynamic_embeddings should be called identify_dynamic_embeddings_batch, but that would change the API.

To Reproduce

first = flair.data.DataPoint()
second = flair.data.DataPoint()
dynamic_tensor1 = torch.tensor([1., 2., 3.], requires_grad=True)
dynamic_tensor2 = torch.tensor([1., 2., 3.], requires_grad=True)
first.set_embedding('dynamic', dynamic_tensor1)
second.set_embedding('dynamic', dynamic_tensor2)
dynamic_data_pair = flair.data.DataPair(first, second)
print(flair.training_utils.identify_dynamic_embeddings([dynamic_data_pair]))

Expected behavior

This should return ['dynamic']

Logs and Stack traces


Screenshots

No response

Additional Context

No response

Environment

Versions:

Flair

0.15.1

Pytorch

2.6.0+cu124

Transformers

4.48.2

GPU

False

@MattGPT-ai MattGPT-ai added the bug Something isn't working label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant