IBM / MAX-Question-Answering

Answer questions on a given corpus of text.
https://developer.ibm.com/exchanges/models/all/max-question-answering
Apache License 2.0
33 stars 21 forks source link

ERROR #38

Open mady143 opened 4 years ago

mady143 commented 4 years ago

Hi @kocolosk @rmg @xuhdev @jjasghar @MLnick , I had clone this repository and run this command sudo docker run -it -p 5000:5000 codait/max-question-answering i had got display a page in the web browser like

webbrowser_image

In post section i am getting the response through swagger and i am getting the result..

but http://localhost:5000/model/predict its not working its showing an error message like

error_message

now i want to display in separate page and i want it as separate API. and also can you explain the process of execution from starting..

Thanks and Regards, Manikantha Sekhar...

MLnick commented 4 years ago

Please follow the instructions for testing on the command line using curl: https://github.com/IBM/MAX-Question-Answering#3-use-the-model

e.g.

curl -X POST "http://localhost:5000/model/predict" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"paragraphs\": [{ \"context\": \"John lives in Brussels and works for the EU\", \"questions\": [\"Where does John Live?\",\"What does John do?\",\"What is his name?\" ]},{ \"context\": \"Jane lives in Paris and works for the UN\", \"questions\": [\"Where does Jane Live?\",\"What does Jane do?\" ]}]}"

If you want to see a full example of how to use this as an API e.g. via a Python web app, see: https://github.com/IBM/MAX-Question-Answering-Web-App

mady143 commented 4 years ago

@MLnick , Thank you so much for the reply now i am checking with Web-app side if any issues i will let you know.

Thanks and Regards, Manikantha Sekhar.

mady143 commented 4 years ago

@MLnick @kocolosk @rmg @xuhdev , While i am trying to run https://github.com/IBM/MAX-Question-Answering/blob/master/app.py app.py file after build the docker i am getting an error like

tensorflow.python.framework.errors_impl.NotFoundError: assets/vocab.txt; No such file or directory i was confused to find the vocab.txt actually while building the docker file its downloaded the model_file=assets.tar.gz but i was unable to find that file bellow screenshot shows about the docker built

docker_build

can you rectify the issue i an one knows about the issue.....

Thanks and Regards, Manikantha Sekhar...

xuhdev commented 4 years ago

If you remove cache (docker rmi max-question-answering), you should see that assets/vocab.txt is there:

Step 10/12 : RUN if [ "$use_pre_trained_model" = "true" ] ; then       sha512sum -c sha512sums.txt ;     else       if [ -d "./custom_assets/" ] ; then         rm -rf ./assets && ln -s ./custom_assets ./assets ;       fi     fi
 ---> Running in e45ce037d7f0
assets/max_qa_model/saved_model.pb: OK
assets/max_qa_model/variables/variables.data-00000-of-00001: OK
assets/max_qa_model/variables/variables.index: OK
assets/vocab.txt: OK
Removing intermediate container e45ce037d7f0
 ---> 9a748cc441a3
mady143 commented 4 years ago

@xuhdev , Thank you for your response as per your reply i run the command line sudo docker rmi max-question-answering but i got an error like

docker_remove_error

can you tell me reason what happens and also i had a doubt that as per the instruction give in the README.md https://github.com/IBM/MAX-Question-Answering and after deploying the model its suggested to how to use the model by going to the particular url like http://localhost:5000/model/predict to test the json file but while i am running this url in the browser i am getting an error like

url_error

can you explain y??

Thanks and Regrads, Manikantha Sekhar..

xuhdev commented 4 years ago

First question: You need to run docker rmi -f max-question-answering because a container is using this image.

Second question: Visit http://localhost:5000 instead