Skip to content

Commit f8c08fb

Browse files
aronzeke
authored andcommitted
Update README.md
1 parent 63764dc commit f8c08fb

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ We recommend not adding the token directly to your source code, because you don'
3030

3131
## Run a model
3232

33-
Create a new Python file and add the following code:
33+
Create a new Python file and add the following code, replacing the model identifier and input with your own:
3434

3535
```python
3636
>>> import replicate
@@ -42,6 +42,24 @@ Create a new Python file and add the following code:
4242
['https://replicate.com/api/models/stability-ai/stable-diffusion/files/50fcac81-865d-499e-81ac-49de0cb79264/out-0.png']
4343
```
4444

45+
Some models, particularly language models, may be missing the version string. Refer to the API documentation for the model for more on the specifics:
46+
47+
```python
48+
replicate.run(
49+
"meta/llama-2-70b-chat",
50+
input={
51+
"debug": False,
52+
"top_k": 50,
53+
"top_p": 1,
54+
"prompt": "Can you write a poem about open source machine learning? Let's make it in the style of E. E. Cummings.",
55+
"temperature": 0.5,
56+
"system_prompt": "You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.\n\nIf a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.",
57+
"max_new_tokens": 500,
58+
"min_new_tokens": -1
59+
},
60+
)
61+
```
62+
4563
Some models, like [andreasjansson/blip-2](https://replicate.com/andreasjansson/blip-2), have files as inputs.
4664
To run a model that takes a file input,
4765
pass a URL to a publicly accessible file.

0 commit comments

Comments
 (0)