AbrahamSanders / seq2seq-chatbot

A sequence2sequence chatbot implementation with TensorFlow.
MIT License
99 stars 56 forks source link

How to run the chatbot using flask? #12

Closed G-Slient closed 5 years ago

G-Slient commented 5 years ago

i am not able to run the application using the flask ? can you provide a steps to run it ?

AbrahamSanders commented 5 years ago

Hello @G-Slient please take a look here for directions to start the web application. It is not yet compatible with Flask v1.x as they made changes to the way applications are launched - so you will need to use flask 0.12.4. If that will mess up your environment, use a virtual env for the chatbot for now until I can get it to work with the latest version.

Let me know how it goes!

G-Slient commented 5 years ago

this was made only for windows right? i was trying to run on ubuntu and it did not work. Try to help me with how to do it in ubuntu ? which tensorflow version are u using for this project?

AbrahamSanders commented 5 years ago

It will work on Ubuntu, however you won't be able to use the windows batch files to launch it. You can simply run the equivalent script in your Anaconda console: a) Set your working directory to the seq2seq-chatbot folder (contains /models, /datasets, etc...)

b) Run:

set FLASK_APP=chat_web.py
flask serve_chat models/cornell_movie_dialog/trained_model_v2/best_weights_training.ckpt -p 8080

c) In browser go to http://localhost:8080/chat_ui

You should use flask v0.12.4 and latest version of flask-restful, jsonpickle, and tensorflow.

Let me know if you have any further issues.

G-Slient commented 5 years ago

@AbrahamSanders i am using flask 0.12.4 version and flask-restful, jsonpickle, tensorflow lastest as u said. but i am struck with this. i tried to find serve_chat command in the documentation also but i could not get any reference for it. did u face such issue? can u help with it?

`set FLASK_APP=chat_web.py
flask serve_chat models/cornell_movie_dialog/trained_model_v2/best_weights_training.ckpt

Usage: flask [OPTIONS] COMMAND [ARGS]...
Try "flask --help" for help.
``
Error: No such command "serve_chat".`
AbrahamSanders commented 5 years ago

Hey @G-Slient I did encounter this after doing a conda update - it turns out click v7.0 caused it to stop working. I will open a bug against it. For now, roll back to click==6.7 and you should be good.

AbrahamSanders commented 5 years ago

Hey @G-Slient, I am closing this issue as there has been 25 days of inactivity. If you are still unable to get it working with click==6.7 please let me know.

Regards

sunn-e commented 5 years ago

hey @AbrahamSanders I tried it using click==6.7, I'm still getting same error.

sunn-e commented 5 years ago

X:\New folder\Github repos\seq2seq-chatbot\seq2seq-chatbot\models>flask serve_chat "models\cornell_movie_dialog\trained_model_v2\best_weights_training.ckpt" -p 8080 Usage: flask [OPTIONS] COMMAND [ARGS]...

Error: No such command "serve_chat".