Commit 59ed3ca3 authored by Jim Hoekstra's avatar Jim Hoekstra 👋🏻
Browse files

Merge branch 'deploy' into 'master'

Deploy

See merge request !4
parents 8023cfeb c181a7ba
FROM python:3
RUN groupadd -r msx_user
RUN useradd --create-home -r -g msx_user msx_user
ENV PYTHONUNBUFFERED=1
WORKDIR /app
COPY ./requirements.txt /app/requirements.txt
RUN pip install -r requirements.txt
USER msx_user
COPY scripts/download_model.py /app/scripts/download_model.py
RUN python scripts/download_model.py
COPY . /app
ENTRYPOINT gunicorn --bind 0.0.0.0:8000 --workers 1 --timeout 360 dash_app.app:server
......@@ -9,5 +9,5 @@ todo
todo
## How to run
To run the development server locally, execute `python run_app.py`, and
To run the development server locally, execute `python scripts/run_debug_server.py`, and
in the browser navigate to http://127.0.0.1:8050/
......@@ -15,7 +15,7 @@ external_stylesheets = [
]
app = dash.Dash(name=__name__, external_stylesheets=external_stylesheets)
app = dash.Dash(name=__name__, external_stylesheets=external_stylesheets, url_base_pathname='/msx/')
graph = Graph()
graph.fill_with_associations('fruit')
cyto_graph = graph.get_graph('msx-graph')
......@@ -43,6 +43,9 @@ app.layout = html.Div(children=[
])
server = app.server
@app.callback(
Output(component_id='msx-graph', component_property='elements'),
Input(component_id='base-word-submit', component_property='n_clicks'),
......
import gensim.downloader as api
import stringdist as sdi
class AssociatedWords:
def __init__(self):
......@@ -18,7 +19,6 @@ class AssociatedWords:
def set_base_word(self, word):
self.base_word = word
self.gensim_result = self.model.most_similar(self.base_word, topn=self.N_RESULTS)
# self.gensim_result = [('apple', 1.0), ('banana', 1.0), ('strawberry', 1.0)]
self.filter_results()
def filter_results(self):
......
Brotli==1.0.9
click==7.1.2
dash==1.19.0
dash-core-components==1.15.0
dash-cytoscape==0.2.0
dash-html-components==1.1.2
dash-renderer==1.9.0
dash-table==4.11.2
Flask==1.1.2
Flask-Compress==1.9.0
future==0.18.2
gensim==3.8.3
gunicorn==20.0.4
itsdangerous==1.1.0
Jinja2==2.11.3
MarkupSafe==1.1.1
numpy==1.20.1
plotly==4.14.3
retrying==1.3.3
scipy==1.6.1
six==1.15.0
smart-open==4.2.0
Werkzeug==1.0.1
import gensim.downloader as api
model = api.load('glove-twitter-200')
......@@ -2,4 +2,4 @@ from dash_app.app import app
if __name__ == '__main__':
app.run_server(debug=False)
app.run_server(debug=True)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment