Skip to content

Commit

Permalink
working on bottle to flask
Browse files Browse the repository at this point in the history
  • Loading branch information
kirtansakariya committed Sep 15, 2019
1 parent b6d90f1 commit 7db5a6a
Show file tree
Hide file tree
Showing 6 changed files with 1,427 additions and 9 deletions.
10 changes: 5 additions & 5 deletions topicexplorer/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import platform
import warnings

from topicexplorer import (init, prep, train, server, notebook,
from topicexplorer import (init, prep, train, server_flask, notebook,
demo, update, metadata, export, tezimport, export_html)

from topicexplorer.lib.util import is_valid_filepath
Expand Down Expand Up @@ -115,14 +115,14 @@ def main():

# Launch Parser
parser_launch = parsers.add_parser('launch', help="Serve the trained LDA models")
server.populate_parser(parser_launch)
server_flask.populate_parser(parser_launch)
parser_launch.set_defaults(func="launch")

# Serve Parser
parser_serve = parsers.add_parser('serve',
help="Serve a single LDA model, helper for `topicexplorer launch`," +
"rarely called directly")
server.populate_parser(parser_serve)
server_flask.populate_parser(parser_serve)
parser_serve.set_defaults(func="serve")

# Notebook Parser
Expand Down Expand Up @@ -250,8 +250,8 @@ def benchmark(fn):
elif args.func == 'launch' or args.func == 'serve':
# Note that we are only benchmarking the creation process - obviously
# benches of the serve process will take longer
app = benchmark(server.create_app)(args)
server.main(args, app)
app = benchmark(server_flask.create_app)(args)
server_flask.main(args, app)


elif args.func == 'notebook':
Expand Down
6 changes: 3 additions & 3 deletions topicexplorer/extensions/ap.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ def init(app, config_file):

raw_corpus_path = config.get('main', 'raw_corpus', fallback='ap/')

@app.route('/fulltext/<doc_id>')
def get_doc(doc_id):
return static_file(doc_id, root=raw_corpus_path)
# @app.route('/fulltext/<doc_id>')
# def get_doc(doc_id):
# return static_file(doc_id, root=raw_corpus_path)


def label(doc):
Expand Down
Loading

0 comments on commit 7db5a6a

Please sign in to comment.