-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
add sqlite pragma settings to sql_storage.py - change distinct to aggregate in mongodb.py #916
Conversation
Also, change default_session.id to default_conversation_id Those examples were broken somewhere between 7.4 and 7.6. |
@@ -116,7 +116,7 @@ def get_response(self, input_item, conversation_id=None): | |||
|
|||
if not self.read_only: | |||
self.learn_response(statement, previous_statement) | |||
self.storage.add_to_converation(conversation_id, statement, response) | |||
self.storage.add_to_conversation(conversation_id, statement, response) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@lesleslie There are some great changes here, thank you. Once the tests are passing I'll be happy to merge in your changes. Thank you again. |
Thank you.
This is a great app and I'm thrilled to be able to contribute to it.
…-- les
On Aug 10, 2017 2:43 PM, "Gunther Cox" ***@***.***> wrote:
@lesleslie <https://github.com/lesleslie> There are some great changes
here, thank you. Once the tests are passing I'll be happy to merge in your
changes.
Thank you again.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#916 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AOUGNzhIOkcQoBp1HBlwTPDe_1VfzKETks5sW3l0gaJpZM4Ox279>
.
|
Just fyi, you should expect contributions from me for the kensor/tensor
flow logic adapter as well as Facebook messenger input and output adapters.
…On Aug 10, 2017 6:15 PM, "les" ***@***.***> wrote:
Thank you.
This is a great app and I'm thrilled to be able to contribute to it.
-- les
On Aug 10, 2017 2:43 PM, "Gunther Cox" ***@***.***> wrote:
> @lesleslie <https://github.com/lesleslie> There are some great changes
> here, thank you. Once the tests are passing I'll be happy to merge in your
> changes.
>
> Thank you again.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#916 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AOUGNzhIOkcQoBp1HBlwTPDe_1VfzKETks5sW3l0gaJpZM4Ox279>
> .
>
|
Ok - all tests pass! Sorry about the sloppy pull request and all the commits. I have a better idea of the process now. This was also my first experience with Travis-CI but I think I have a good handle on that now too. I will note it hear that increasing the sort buffer size using: self.client.admin.command({'setParameter': 1, 'internalQueryExecMaxBlockingSortBytes': 44040192}) does not currently work for Python 2 on Linux or Python 3 on Windows. |
@@ -22,7 +22,7 @@ | |||
output_adapter='chatterbot.output.TerminalAdapter' | |||
) | |||
|
|||
DEFAULT_SESSION_ID = bot.default_session.id | |||
DEFAULT_SESSION_ID = bot.default_conversation_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could also rephrase to DEFAULT_CONVERSATION_ID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
examples/learning_new_response.py
Outdated
@@ -16,7 +16,7 @@ | |||
|
|||
bot.train("chatterbot.corpus.english") | |||
|
|||
DEFAULT_SESSION_ID = bot.default_session.id | |||
DEFAULT_SESSION_ID = bot.default_conversation_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could also rephrase to DEFAULT_CONVERSATION_ID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
chatterbot/storage/mongodb.py
Outdated
@@ -92,6 +92,9 @@ def __init__(self, **kwargs): | |||
# Use the default host and port | |||
self.client = MongoClient(self.database_uri) | |||
|
|||
# Increase the sort buffer to 42M | |||
self.client.admin.command({'setParameter': 1, 'internalQueryExecMaxBlockingSortBytes': 44040192}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like tests are failing after this change;
pymongo.errors.OperationFailure: no such command: 'internalQueryExecMaxBlockingSortBytes', bad cmd: '{
internalQueryExecMaxBlockingSortBytes: 44040192, setParameter: 1
}'
Thank you again. Fantastic job @lesleslie putting all this together. It is greatly appreciated! |
This commit is in response to #873. It allows sqlite pragma settings to be set. This commit sets
PRAGMA journal_mode=WAL
PRAGMA synchronous=NORMAL
when sqlite is used for the database. These settings should speed things up while still maintaining data integrity.
See #873 for more details.