-
Notifications
You must be signed in to change notification settings - Fork 248
Add replicate.run() #79
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
Conversation
To be consistent with the JavaScript library. Signed-off-by: Ben Firshman <ben@firshman.com>
I took that out a while ago because it made nothing copy-paste-able, unless I missed something:
|
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.
Looks good to me.
Fair. I guess I'm used to copy and pasting. It's a common pattern with Python libraries to show a REPL session: https://requests.readthedocs.io/en/latest/ I'll leave this for now for the sake of saving time, and we can iterate on it again at some point. |
Holding off on merging because we'll need to ship a new version ASAP because the readme acts as the documentation. If someone wants to merge and ship a release feel free. 😄 |
Context: > Model.predict was removed in #71. It points users to Version.predict, but that method was deprecated in favor of replicate.run in #79. #137 Trying the example in the current iteration of `replicate/replicate-python` would return the following exception: ```python discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Version' object has no attribute 'predict' ```
Context: > Model.predict was removed in #71. It points users to Version.predict, but that method was deprecated in favor of replicate.run in #79. #137 Trying the example in the current iteration of `replicate/replicate-python` would return the following exception: ```python discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Version' object has no attribute 'predict' ``` Signed-off-by: Michael Lee <michaellee@Michaels-MacBook-Pro.local>
Context: > Model.predict was removed in #71. It points users to Version.predict, but that method was deprecated in favor of replicate.run in #79. #137 Trying the example in the current iteration of `replicate/replicate-python` would return the following exception: ```python discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Version' object has no attribute 'predict' ``` Signed-off-by: Michael Lee <michaellee@Michaels-MacBook-Pro.local>
Context: > Model.predict was removed in #71. It points users to Version.predict, but that method was deprecated in favor of replicate.run in #79. #137 Trying the example in the current iteration of `replicate/replicate-python` would return the following exception: ```python discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Version' object has no attribute 'predict' ``` Signed-off-by: GothReigen <reigen@replicate.com>
Context: > Model.predict was removed in #71. It points users to Version.predict, but that method was deprecated in favor of replicate.run in #79. #137 Trying the example in the current iteration of `replicate/replicate-python` would return the following exception: ```python discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Version' object has no attribute 'predict' ``` Signed-off-by: GothReigen <reigen@replicate.com>
To be consistent with the JavaScript library. The rest of the API is only vaguely consistent, but this gets us a long way.
Full examples in the README.
As an aside, I reformatted the readme to use the pretty standard Python REPL format. Shame we lost that – it made for a consistent copy & paste REPL session, and lost the syntax highlighting.