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
Error of running zero-shot on dbpedia dataset #14
Comments
I solved it by modifying the code in openprompt: def incorporate_text_example(self,
example: InputExample,
text = None,
):
if text is None:
text = self.text.copy()
else:
text = text.copy()
for i, d in enumerate(text):
if 'placeholder' in d:
##################
tempa = d.get("post_processing", lambda x:x)
if tempa == "lambda x:x.strip('.')":
tempa = lambda x:x.strip('.')
tempb = tempa(getattr(example, d['placeholder']))
text[i] = d["add_prefix_space"] + tempb
##################
elif 'meta' in d:
text[i] = d["add_prefix_space"] + d.get("post_processing", lambda x:x)(example.meta[d['meta']])
elif 'soft' in d:
text[i] = ''; # unused
elif 'mask' in d:
text[i] = '<mask>'
elif 'special' in d:
text[i] = d['special']
elif 'text' in d:
text[i] = d["add_prefix_space"] + d['text']
else:
raise ValueError(f'can not parse {d}')
return text |
can you pr ? |
What do you mean by "pr"? |
how do you put this repo with openprompt? my code goes wrong with "OSError: ../plm_cache/roberta-large is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models' |
Maybe you need to change the path of |
I have already installed the latest openprompt package. And the script for KPT is
And I got the error:
Could you please check about it?
The text was updated successfully, but these errors were encountered: