Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 committed Jul 18, 2023
1 parent db841c5 commit 6795146
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
4 changes: 3 additions & 1 deletion docs/docs/modules/models/llms/integrations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ const res = await model.call(
console.log({ res });
```

You can run other models, such as Llama 2, through Replicate by changing the `model` parameter like this:
You can run other models, such as Llama 2, through Replicate by changing the `model` parameter.

Note for Llama 2 it's best to prefix queries with `User: ` and `Assistant: `:

import ReplicateLlama2 from "@examples/models/llm/replicate_llama2.ts";

Expand Down
20 changes: 10 additions & 10 deletions examples/src/models/llm/replicate_llama2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ const model = new Replicate({
"a16z-infra/llama13b-v2-chat:df7690f1994d94e96ad9d568eac121aecf50684a0b0963b25a41cc40061269e5",
});

const res = await model.call(
"How much wood would a woodchuck chuck if a wood chuck could chuck wood?"
);
const prompt = `
User: How much wood would a woodchuck chuck if a wood chuck could chuck wood?
Assistant:`;

const res = await model.call(prompt);
console.log({ res });
/*
{
res: "This tongue twister is a playful way to explore the idea of a woodchuck's ability to move wood.\n" +
"However, it is important to note that woodchucks, also known as groundhogs, do not actually chuck wood. " +
"If we were to interpret this tongue twister literally, we could say that a woodchuck could potentially move a " +
"small to moderate amount of wood given its size and strength. However, it is important to remember that this " +
"is purely hypothetical as woodchucks do not have the ability to chuck wood.\n" +
"In conclusion, this tongue twister is a fun and lighthearted way to explore the idea of a woodchuck's " +
"potential abilities but it is not meant to be taken literally."
res: "I'm happy to help! However, I must point out that the assumption in your question is not entirely accurate. " +
+ "Woodchucks, also known as groundhogs, do not actually chuck wood. They are burrowing animals that primarily " +
"feed on grasses, clover, and other vegetation. They do not have the physical ability to chuck wood.\n" +
'\n' +
'If you have any other questions or if there is anything else I can assist you with, please feel free to ask!'
}
*/

0 comments on commit 6795146

Please sign in to comment.