GithubHelp home page GithubHelp logo

allenai / lm-explorer Goto Github PK

View Code? Open in Web Editor NEW
128.0 11.0 30.0 155 KB

interactive explorer for language models

License: Apache License 2.0

Shell 1.56% Dockerfile 0.45% Python 37.13% JavaScript 31.20% HTML 6.49% Jsonnet 23.17%

lm-explorer's Introduction

lm-explorer

interactive explorer for language models (currently only OpenAI GPT-2)

Running with Docker

# This creates a local directory where the model can be cached so you don't
# have to download it everytime you execute 'docker run'.
$ mkdir -p /$HOME/.pytorch_pretrained_bert
$ docker build -t lm-explorer:latest .
$ docker run -p 8000:8000 \
    -v /$HOME/.pytorch_pretrained_bert:/root/.pytorch_pretrained_bert \
    -v $(pwd):/local \
    lm-explorer:latest \
    python app.py --port 8000 --dev

Running without Docker

First create and activate a Python 3.6 (or later) virtual environment. Then install the requirements

$ pip install -r requirements.txt

and start the app

$ python app.py --port 8000 --dev

lm-explorer's People

Contributors

codeviking avatar eric-wallace avatar joelgrus avatar jonborchardt avatar schmmd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lm-explorer's Issues

Python 3.8 May Not Work?

Just an FYI, I had dependency issues installing the requirements with Python 3.8, but no problem with Python 3.6. It may be useful to change the documentation to require specifically Python 3.6 or maybe even Python 3.7?

Empty page by runinng app.py

Following Running without Docker, I got empty page after runningpython app.py --port 8000 --dev and access to localhost:8000.

It seems ok, but I have no idea why I got empty page.

INFO:werkzeug:127.0.0.1 - - [15/Apr/2020 22:11:20] "GET / HTTP/1.1" 200 -

#20 was caused by version of styled-components, thus I fixed styled-components to latest version(5.1.0) but it failed.

static/app.js is not encoded as utf-8 when loaded

In app.py line 53 app_js = open("static/app.js") is not loaded with utf-8 encoding resulting in the hasher in line 54 complaining:

UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 9125: character maps to <undefined>

I solved it by adding the encoding: app_js = open("static/app.js", encoding='utf-8')

weird behavior with textarea resizing

if you shrink the input textarea horizontally, the column it's in keeps the same size.

Screenshot from 2019-03-30 11-11-17

then when you restore it to the original width, the column grows, forcing the word choices off the screen

Screenshot from 2019-03-30 11-11-30

Blank page upon running the application

I used pip install -r requirements.txt to install all requirements first and ran python app.py --port 8080 --dev to run the app.

However, I get a blank page on Port 8080.

And the terminal output looks like:

INFO:werkzeug:10.72.16.6 - - [15/Jan/2020 08:37:30] "GET / HTTP/1.1" 200 -
INFO:werkzeug:10.72.16.6 - - [15/Jan/2020 08:37:31] "GET /static/app.js?v=937222bbd3aed82c22ba8ad8e515bd89 HTTP/1.0" 200 -
INFO:werkzeug:10.72.16.6 - - [15/Jan/2020 08:37:32] "GET /static/favicon.ico HTTP/1.0" 200 -

Reason: image not found

python app.py --port 8000 --dev

Traceback (most recent call last):
  File "app.py", line 13, in <module>
    import torch
  File "/Users/fulvio/anaconda3/lib/python3.7/site-packages/torch/__init__.py", line 79, in <module>
    from torch._C import *
ImportError: dlopen(/Users/fulvio/anaconda3/lib/python3.7/site-packages/torch/_C.cpython-37m-darwin.so, 9): Library not loaded: /usr/local/opt/libomp/lib/libomp.dylib
  Referenced from: /Users/fulvio/anaconda3/lib/python3.7/site-packages/torch/lib/libshm.dylib
  Reason: image not found

Empty webpage when run the model (from scratch)

I have cloned this repo to my machine and installed the dependencies as stated but when I run the model with the command python app.py --port 8000 --dev, the resulted web page is empty. Any idea?
I have tried to debug with the console:

styled-components.min.js:1 Uncaught TypeError: Cannot use 'in' operator to search for 'default' in undefined

Uncaught ReferenceError: styled is not defined

Example sentence

Hello,

Is it possible to predict the next or previous word in a sentence as the research claims ?

For example, like Google translate "apple", and produced the example sentences

ๅœ–็‰‡

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.