Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down