Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inference CLI #762

Merged
merged 1 commit into from
Mar 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions snips_nlu/cli/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
)
def parse(training_path, query, verbose=False):
"""Load a trained NLU engine and play with its parsing API interactively"""
from builtins import str
if verbose:
set_nlu_logger(logging.DEBUG)

Expand All @@ -29,6 +30,8 @@ def parse(training_path, query, verbose=False):

while True:
query = input("Enter a query (type 'q' to quit): ").strip()
if not isinstance(query, str):
query = query.decode("utf-8")
if query == "q":
break
print_parsing_result(engine, query)
Expand Down
3 changes: 3 additions & 0 deletions snips_nlu/common/log_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from __future__ import unicode_literals

from builtins import str
from datetime import datetime
from functools import wraps

Expand Down