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

problem with openprompt #311

Open
komi786 opened this issue May 18, 2024 · 1 comment
Open

problem with openprompt #311

komi786 opened this issue May 18, 2024 · 1 comment

Comments

@komi786
Copy link

komi786 commented May 18, 2024

i tried to use latest version of openprompt (pip install openprompt and aslo tried by cloning from github) with transformer 4.41 and 4.42 b

`oduleNotFoundError Traceback (most recent call last)
Cell In[2], line 9
7 print(transformers.version)
8 print(transformers.file)
----> 9 import openprompt
10 print(openprompt.version)
11 print(openprompt.file)

File /usr/local/lib/python3.10/dist-packages/openprompt/init.py:2
1 version = "1.0.1"
----> 2 from .pipeline_base import PromptDataLoader, PromptModel, PromptForClassification, PromptForGeneration
3 from .utils import *
4 from .prompt_base import Template, Verbalizer

File /usr/local/lib/python3.10/dist-packages/openprompt/pipeline_base.py:4
2 from torch.utils.data.sampler import RandomSampler
3 from transformers.configuration_utils import PretrainedConfig
----> 4 from transformers.generation_utils import GenerationMixin
5 import torch
6 import torch.nn as nn

ModuleNotFoundError: No module named 'transformers.generation_utils'`

@xiyang-aads-lilly
Copy link

xiyang-aads-lilly commented May 20, 2024

change from transformers.generation_utils import GenerationMixin to from transformers import GenerationMixin can solve the problem

I reported this a few days ago: #309

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants