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

Failures with UniversalSentimentAnalysis class #405

Open
saikumaru opened this issue Jun 14, 2024 · 0 comments
Open

Failures with UniversalSentimentAnalysis class #405

saikumaru opened this issue Jun 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@saikumaru
Copy link

Version
Name: pyabsa
Version: 2.4.1.post1

Name: torch
Version: 2.3.1

Name: transformers
Version: 4.41.2

Describe the bug
Unable to successfully execute predict function for UniversalSentimentAnalysis

example file
pyabsa/tasks/UniversalSentimentAnalysis/trainer/trainer.py

Code To Reproduce

from pyabsa.tasks import UniversalSentimentAnalysis as USA

usa_predictor = USA.USAPredictor(checkpoint="multilingual")

examples = [
    '{"text": "keyboard key fragile .", "labels": [{"aspect": "keyboard", "opinion": "fragile", "polarity": "negative", "category": "KEYBOARD#QUALITY"}]}'
]

inference_results = usa_predictor.predict(examples)

print(inference_results)

while True:
    text = input("Please input your text: ")
    inference_results = usa_predictor.predict(text)
    print(inference_results)

Expected behavior
usa_predictor.predict(examples) should output predicted labels, but errors out

Screenshots
Error

RuntimeError: Fail to load the model from multilingual! Please make sure the version of checkpoint and PyABSA are compatible. Try to remove he checkpoint and download again

image

@saikumaru saikumaru added the bug Something isn't working label Jun 14, 2024
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