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

error when using the pytorch demo #1361

Open
Chiaquan opened this issue Nov 28, 2023 · 2 comments
Open

error when using the pytorch demo #1361

Chiaquan opened this issue Nov 28, 2023 · 2 comments

Comments

@Chiaquan
Copy link

File "/home/afbio/miniconda3/envs/lit-nlp/lib/python3.10/site-packages/lit_nlp/examples/sst_pytorch_demo.py", line 237, in <module>
    app.run(main)
  File "/home/afbio/miniconda3/envs/lit-nlp/lib/python3.10/site-packages/absl/app.py", line 308, in run
    _run_main(main, args)
  File "/home/afbio/miniconda3/envs/lit-nlp/lib/python3.10/site-packages/absl/app.py", line 254, in _run_main
    sys.exit(main(argv))
  File "/home/afbio/miniconda3/envs/lit-nlp/lib/python3.10/site-packages/lit_nlp/examples/sst_pytorch_demo.py", line 227, in main
    models = {"sst": SimpleSentimentModel(model_path)}
TypeError: Can't instantiate abstract class SimpleSentimentModel with abstract method predict

I encoutered the problems when using both pytorch demo?And dont know how to deal with?

copybara-service bot pushed a commit that referenced this issue Nov 28, 2023
This class implements the abstract method `predict_minibatch` in `BatchedModel`.

Addressing #1361.

PiperOrigin-RevId: 586041904
@bdu91
Copy link
Collaborator

bdu91 commented Nov 28, 2023

Pls try out the fix above pushed to dev branch, and let us know any issues you still run into. We might do a minor release including this in the future.

@Chiaquan
Copy link
Author

Chiaquan commented Nov 28, 2023 via email

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