Skip to content
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

Support predictions.create with model, version, or deployment parameters #290

Merged
merged 8 commits into from
May 7, 2024

Conversation

mattt
Copy link
Member

@mattt mattt commented Apr 22, 2024

This PR updates predictions.create to support overloads with model, version, or deployment parameters. With these changes, API consumers can more easily change between official models, model versions, and deployments.

import replicate

prediction = replicate.predictions.create(
    model="meta/meta-llama-3-8b-instruct",
    input={"prompt": "write a haiku about corgis"},
)

prediction = replicate.predictions.create(
    version="39ed52f2a78e934b3ba6e2a89f5b1c712de7dfea535525255b1aa35c5565e08b",
    input={"prompt": "a studio photo of a rainbow colored corgi"},
)

prediction = replicate.predictions.create(
    deployment="my-username/my-embeddings-model",
    input={"text": "hello world"},
)

@mattt mattt merged commit eb3cebf into main May 7, 2024
8 checks passed
@mattt mattt deleted the mattt/overload-predictions-create branch May 7, 2024 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant