try fp16 instead of bf16
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ title = "RWKV-5-World-0.1B-v1-20230803-ctx4096.pth"
|
|
10 |
# url = f"https://huggingface.co/BlinkDL/rwkv-5-world/resolve/main/{title}"
|
11 |
# urllib.request.urlretrieve(url, title)
|
12 |
|
13 |
-
model = RWKV(model=title, strategy='cpu
|
14 |
pipeline = PIPELINE(model, "rwkv_vocab_v20230424")
|
15 |
|
16 |
def generate_prompt(instruction, input=None, history=None):
|
@@ -19,7 +19,7 @@ def generate_prompt(instruction, input=None, history=None):
|
|
19 |
|
20 |
if history is not None:
|
21 |
for pair in history:
|
22 |
-
history_str += f"
|
23 |
|
24 |
instruction = instruction.strip().replace('\r\n','\n').replace('\n\n','\n').replace('\n\n','\n')
|
25 |
input = input.strip().replace('\r\n','\n').replace('\n\n','\n').replace('\n\n','\n')
|
|
|
10 |
# url = f"https://huggingface.co/BlinkDL/rwkv-5-world/resolve/main/{title}"
|
11 |
# urllib.request.urlretrieve(url, title)
|
12 |
|
13 |
+
model = RWKV(model=title, strategy='cpu fp16')
|
14 |
pipeline = PIPELINE(model, "rwkv_vocab_v20230424")
|
15 |
|
16 |
def generate_prompt(instruction, input=None, history=None):
|
|
|
19 |
|
20 |
if history is not None:
|
21 |
for pair in history:
|
22 |
+
history_str += f"User: {pair[0]}\n\nAssistant: {pair[1]}\n\n"
|
23 |
|
24 |
instruction = instruction.strip().replace('\r\n','\n').replace('\n\n','\n').replace('\n\n','\n')
|
25 |
input = input.strip().replace('\r\n','\n').replace('\n\n','\n').replace('\n\n','\n')
|