Spaces:
Runtime error
Runtime error
FredZhang7
commited on
Commit
·
d056384
1
Parent(s):
d981c54
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ from rwkv.model import RWKV
|
|
5 |
from rwkv.utils import PIPELINE, PIPELINE_ARGS
|
6 |
|
7 |
ctx_limit = 2048
|
8 |
-
title = "RWKV-5-World-0.
|
9 |
|
10 |
model_path = hf_hub_download(repo_id="BlinkDL/rwkv-5-world", filename=f"{title}")
|
11 |
model = RWKV(model=model_path, strategy='cpu bf16')
|
@@ -16,11 +16,18 @@ def generate_prompt(instruction, input=None):
|
|
16 |
input = input.strip().replace('\r\n','\n').replace('\n\n','\n').replace('\n\n','\n')
|
17 |
if input:
|
18 |
return f"""Instruction: {instruction}
|
|
|
19 |
Input: {input}
|
|
|
20 |
Response:"""
|
21 |
else:
|
22 |
-
return f"""
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
examples = [
|
26 |
["東京で訪れるべき素晴らしい場所とその紹介をいくつか挙げてください。", "", 300, 1.2, 0.5, 0.4, 0.4],
|
|
|
5 |
from rwkv.utils import PIPELINE, PIPELINE_ARGS
|
6 |
|
7 |
ctx_limit = 2048
|
8 |
+
title = "RWKV-5-World-0.4B-v2-20231113-ctx4096.pth"
|
9 |
|
10 |
model_path = hf_hub_download(repo_id="BlinkDL/rwkv-5-world", filename=f"{title}")
|
11 |
model = RWKV(model=model_path, strategy='cpu bf16')
|
|
|
16 |
input = input.strip().replace('\r\n','\n').replace('\n\n','\n').replace('\n\n','\n')
|
17 |
if input:
|
18 |
return f"""Instruction: {instruction}
|
19 |
+
|
20 |
Input: {input}
|
21 |
+
|
22 |
Response:"""
|
23 |
else:
|
24 |
+
return f"""User: hi
|
25 |
+
|
26 |
+
Assistant: Hi. I am your assistant and I will provide expert full response in full details. Please feel free to ask any question and I will always answer it.
|
27 |
+
|
28 |
+
User: {instruction}
|
29 |
+
|
30 |
+
Assistant:"""
|
31 |
|
32 |
examples = [
|
33 |
["東京で訪れるべき素晴らしい場所とその紹介をいくつか挙げてください。", "", 300, 1.2, 0.5, 0.4, 0.4],
|