diff --git a/README.md b/README.md index 91ba9182..e1d8a885 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ We recommend not adding the token directly to your source code, because you don' ## Run a model -Create a new Python file and add the following code: +Create a new Python file and add the following code, replacing the model identifier and input with your own: ```python >>> import replicate @@ -42,6 +42,18 @@ Create a new Python file and add the following code: ['https://replicate.com/api/models/stability-ai/stable-diffusion/files/50fcac81-865d-499e-81ac-49de0cb79264/out-0.png'] ``` +Some models, particularly language models, may not require the version string. Refer to the API documentation for the model for more on the specifics: + +```python +replicate.run( + "meta/llama-2-70b-chat", + input={ + "prompt": "Can you write a poem about open source machine learning?", + "system_prompt": "You are a helpful, respectful and honest assistant.", + }, +) +``` + Some models, like [andreasjansson/blip-2](https://replicate.com/andreasjansson/blip-2), have files as inputs. To run a model that takes a file input, pass a URL to a publicly accessible file.