PAIR-code / lit

The Learning Interpretability Tool: Interactively analyze ML models to understand their behavior in an extensible and framework agnostic interface.
https://pair-code.github.io/lit
Apache License 2.0
3.44k stars 350 forks source link

error when using the pytorch demo #1361

Open Chiaquan opened 7 months ago

Chiaquan commented 7 months ago
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?

bdu91 commented 7 months ago

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 commented 7 months ago

你好,我是林嘉铨,我已收到,感谢你的信件!