Closed AdriG83 closed 6 years ago
@adryr83 It is very difficulty to me find root cause of the above code,
Couple of questions Did your bot working on locally? Do you have heroku logs?
And also see error code of heroku https://devcenter.heroku.com/articles/error-codes, to familiar what exactly is happening
A chatterbot heoku example located here https://github.com/vkosuri/chatterbot-live-example
Hi @vkosuri, my bot works perfectly on locally. I have this Heroku logs:
2017-10-19T08:16:11.000000+00:00 app[api]: Build succeeded 2017-10-19T08:16:44.658372+00:00 heroku[worker.1]: State changed from crashed to starting 2017-10-19T08:16:50.967642+00:00 heroku[worker.1]: Starting process with command
python Magghy.py 2017-10-19T08:16:51.590782+00:00 heroku[worker.1]: State changed from starting to up 2017-10-19T08:16:54.673293+00:00 heroku[worker.1]: State changed from up to crashed 2017-10-19T08:16:54.665246+00:00 heroku[worker.1]: Process exited with status 1 2017-10-19T08:16:54.331086+00:00 app[worker.1]: /app/lang/italiano/chatcorpus/ conversations.yml Training: [# ] 4%Traceback (most recent call last): 2017-10-19T08:16:54.529802+00:00 app[worker.1]: File "Magghy.py", line 27, in <module> 2017-10-19T08:16:54.529918+00:00 app[worker.1]: chatter.train() 2017-10-19T08:16:54.530022+00:00 app[worker.1]: self.localdir 2017-10-19T08:16:54.530029+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/chatterbot/trainers.py", line 137, in train 2017-10-19T08:16:54.530155+00:00 app[worker.1]: Response(previous_statement_text) 2017-10-19T08:16:54.530159+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/chatterbot/conversation/response.py", line 8, in __init__ 2017-10-19T08:16:54.529922+00:00 app[worker.1]: File "/app/magghybot.py", line 37, in train 2017-10-19T08:16:54.530238+00:00 app[worker.1]: import dateutil.parser as date_parser 2017-10-19T08:16:54.530252+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/dateutil/parser.py", line 158 2017-10-19T08:16:54.530254+00:00 app[worker.1]: l.append("%s=%s" % (attr,
value)) 2017-10-19T08:16:54.530274+00:00 app[worker.1]: ^ 2017-10-19T08:16:54.530277+00:00 app[worker.1]: SyntaxError: invalid syntax
I think the problem caused by the two lines (29 and 30) of magghybot.py file.
I wrote these lines:
self.instdir = "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chatterbot_corpus/data" + self.language + "/"
self.localdir = os.path.abspath(os.path.dirname(sys.argv[0])) + "/lang/" + self.language + "/chatcorpus/"
I put the conversations of my bot in specific files and I indicated the location of them in "self.instdir" and in "self.localdir". For deploy, where can I put them? And how can I indicate their path?
Thanks a lot!
Configuration on Heroku is not a straight line graph. It took me a while to set it up with adverto.ai vis-a-vis using this wonderful chatterbot API. Unless I can sit with you on this; but for now, let me hint you on the following to avoid a recurrent crash of your program on Heroku (hope it helps).
Create the settings_dev.py
separate from the setting_prod.py
and switch either one to your settings.py
depending on the one you are working on.
2. You may want to consider removing the following during training of the bot and replace after training:
logic_adapters=[
"chatterbot.logic.MathematicalEvaluation",
"chatterbot.logic.TimeLogicAdapter",
"chatterbot.logic.BestMatch"
],
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Hi, I created my first Telegram chatbot and I deployed it on Heroku.
It doesn't work. My program has these files:
The logs are:
In Procfile I wrote:
In magghybot.py file the code is:
In Magghy.py, I wrote:
What is the problem? Please help me!
Thanks a lot!
Adri