Skip to content

Conversation

@mattt
Copy link
Contributor

@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
@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.

2 participants