View Code? Open in Web Editor
NEW
Minimal Interactive Attention Visualization
License: Apache License 2.0
Python 31.22%
HTML 54.86%
CSS 7.03%
JavaScript 6.89%
attnvis's People
attnvis's Issues
Thanks for creating this tool! Installation went fine, and when I run it, all goes well until I click the "send" button on the browser. (Chrome or Brave, on MacOS 10.15), then it fails.
I just ran with the defaults, GPT-2 and the default sentence.
Here's a log from running the server:
$ python server.py
Namespace(host=None, nodebug=False, port='8888')
Serving Flask app "server" (lazy loading)
Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
Debug mode: on
Running on http://127.0.0.1:8888/ (Press CTRL+C to quit)
Restarting with stat
Namespace(host=None, nodebug=False, port='8888')
Debugger is active!
Debugger PIN: 138-828-520
127.0.0.1 - - [16/Feb/2020 22:48:31] "GET / HTTP/1.1" 302 -
127.0.0.1 - - [16/Feb/2020 22:48:31] "GET /client/index.html HTTP/1.1" 200 -
127.0.0.1 - - [16/Feb/2020 22:48:31] "GET /client/styles.css HTTP/1.1" 200 -
127.0.0.1 - - [16/Feb/2020 22:48:32] "GET /client/tools..js HTTP/1.1" 200 -
127.0.0.1 - - [16/Feb/2020 22:48:32] "GET /favicon.ico HTTP/1.1" 404 -
Downloading: 100%|███████████████████████████████████████████████████████████████████████████████████████████| 224/224 [00:00<00:00, 63.0kB/s]
Downloading: 100%|█████████████████████████████████████████████████████████████████████████████████████████| 548M/548M [00:27<00:00, 19.8MB/s]
127.0.0.1 - - [16/Feb/2020 22:49:07] "POST /api/attn HTTP/1.1" 500 -
Traceback (most recent call last):
File "/Users/shawley/anaconda/envs/attnvis/lib/python3.6/site-packages/flask/app.py", line 2463, in call
return self.wsgi_app(environ, start_response)
File "/Users/shawley/anaconda/envs/attnvis/lib/python3.6/site-packages/flask/app.py", line 2449, in wsgi_app
response = self.handle_exception(e)
File "/Users/shawley/anaconda/envs/attnvis/lib/python3.6/site-packages/flask/app.py", line 1866, in handle_exception
reraise(exc_type, exc_value, tb)
File "/Users/shawley/anaconda/envs/attnvis/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/Users/shawley/anaconda/envs/attnvis/lib/python3.6/site-packages/flask/app.py", line 2446, in wsgi_app
response = self.full_dispatch_request()
File "/Users/shawley/anaconda/envs/attnvis/lib/python3.6/site-packages/flask/app.py", line 1951, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Users/shawley/anaconda/envs/attnvis/lib/python3.6/site-packages/flask/app.py", line 1820, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/Users/shawley/anaconda/envs/attnvis/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/Users/shawley/anaconda/envs/attnvis/lib/python3.6/site-packages/flask/app.py", line 1949, in full_dispatch_request
rv = self.dispatch_request()
File "/Users/shawley/anaconda/envs/attnvis/lib/python3.6/site-packages/flask/app.py", line 1935, in dispatch_request
return self.view_functionsrule.endpoint
File "/Users/shawley/Downloads/attnvis/server.py", line 38, in attn
loaded_models[model_name] = AttentionGetter(model_name)
File "/Users/shawley/Downloads/attnvis/api.py", line 19, in init
self.model = AutoModel.from_pretrained(model_name, output_attentions=True).to(
File "/Users/shawley/anaconda/envs/attnvis/lib/python3.6/site-packages/transformers/modeling_auto.py", line 377, in from_pretrained
return model_class.from_pretrained(pretrained_model_name_or_path, *model_args, config=config, **kwargs)
File "/Users/shawley/anaconda/envs/attnvis/lib/python3.6/site-packages/transformers/modeling_utils.py", line 463, in from_pretrained
model = cls(config, *model_args, **model_kwargs)
TypeError: init () got an unexpected keyword argument 'output_attentions'