Skip to content

Commit 6b6965f

Browse files
committed
added references
1 parent b8dddc0 commit 6b6965f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

docs/docs/integrations/llms/rwkv.mdx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ from langchain_community.llms import RWKV
4646

4747
def generate_prompt(instruction, input=None):
4848
if input:
49-
return f"""Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
49+
return f"""Below is an instruction that describes a task, paired with an input that provides
50+
further context. Write a response that appropriately completes the request.
5051
5152
# Instruction:
5253
{instruction}
@@ -57,15 +58,20 @@ def generate_prompt(instruction, input=None):
5758
# Response:
5859
"""
5960
else:
60-
return f"""Below is an instruction that describes a task. Write a response that appropriately completes the request.
61+
return f"""Below is an instruction that describes a task. Write a response that
62+
appropriately completes the request.
6163
6264
# Instruction:
6365
{instruction}
6466
6567
# Response:
6668
"""
6769

68-
model = RWKV(model="./models/RWKV-4-Raven-3B-v7-Eng-20230404-ctx4096.pth", strategy="cpu fp32", tokens_path="./rwkv/20B_tokenizer.json")
70+
model = RWKV(
71+
model="./models/RWKV-4-Raven-3B-v7-Eng-20230404-ctx4096.pth",
72+
strategy="cpu fp32",
73+
tokens_path="./rwkv/20B_tokenizer.json"
74+
)
6975
response = model.invoke(generate_prompt("Once upon a time, "))
7076
```
7177

0 commit comments

Comments
 (0)