Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -12,8 +12,8 @@ model = RWKV(model=model_path, strategy='cpu bf16')
|
|
12 |
pipeline = PIPELINE(model, "rwkv_vocab_v20230424")
|
13 |
|
14 |
def generate_prompt(context, question):
|
15 |
-
|
16 |
-
|
17 |
return f"""CONTEXT:{context}
|
18 |
QUESTION:{question}
|
19 |
ANSWER:"""
|
|
|
12 |
pipeline = PIPELINE(model, "rwkv_vocab_v20230424")
|
13 |
|
14 |
def generate_prompt(context, question):
|
15 |
+
context = context.strip().replace('\r\n','\n').replace('\n\n','\n').replace('\n\n','\n')
|
16 |
+
question = question.strip().replace('\r\n','\n').replace('\n\n','\n').replace('\n\n','\n')
|
17 |
return f"""CONTEXT:{context}
|
18 |
QUESTION:{question}
|
19 |
ANSWER:"""
|