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

Can't import EmbeddingAugmenter in windows 10 #424

Closed
nadavbeno opened this issue Feb 23, 2021 · 2 comments
Closed

Can't import EmbeddingAugmenter in windows 10 #424

nadavbeno opened this issue Feb 23, 2021 · 2 comments
Assignees
Labels
augmentation issues related to augmentation setup issues installation help, environment issues, other advice for setting up TextAttack

Comments

@nadavbeno
Copy link

After installing the package (from pip install or from setup.py)
I have the following python code:
from textattack.augmentation import WordNetAugmenter, EmbeddingAugmenter, EasyDataAugmenter, CharSwapAugmenter

but I get an error:
Exception: Could not find word_embeddings\paragramcf on server.

I tried to clear the cache but nothing helps.
What can I do?

@shensmobile
Copy link

It's because os.path.join is joining the download link for S3 using mixed slashes. You'll see in the terminal the following statement before the error:

textattack: Downloading https://textattack.s3.amazonaws.com/word_embeddings\paragramcf.

The mis-matching slash before paragramcf will cause the download to fail. I fixed this by adding .replace("\\","/") after the os.path.join() command in word_embeddings.py on line 274.

It's a hacky fix but it'll get you going :)

@tk-dev11 tk-dev11 added the setup issues installation help, environment issues, other advice for setting up TextAttack label Apr 5, 2021
FrancoMuniz added a commit to FrancoMuniz/TextAttack that referenced this issue May 10, 2021
jxmorris12 added a commit that referenced this issue May 23, 2021
@Hanyu-Liu-123 Hanyu-Liu-123 added the augmentation issues related to augmentation label Sep 1, 2021
@Hanyu-Liu-123 Hanyu-Liu-123 self-assigned this Sep 1, 2021
@Hanyu-Liu-123
Copy link
Collaborator

I think this issue has been fixed by pull request #461 so it will be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
augmentation issues related to augmentation setup issues installation help, environment issues, other advice for setting up TextAttack
Projects
None yet
Development

No branches or pull requests

4 participants