Spaces:
Runtime error
Runtime error
FredZhang7
commited on
Commit
·
5089be1
1
Parent(s):
d056384
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ pipeline = PIPELINE(model, "rwkv_vocab_v20230424")
|
|
14 |
def generate_prompt(instruction, input=None):
|
15 |
instruction = instruction.strip().replace('\r\n','\n').replace('\n\n','\n').replace('\n\n','\n')
|
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}
|
@@ -44,9 +44,9 @@ def evaluate(
|
|
44 |
input=None,
|
45 |
token_count=200,
|
46 |
temperature=1.0,
|
47 |
-
top_p=0.
|
48 |
-
presencePenalty = 0.
|
49 |
-
countPenalty = 0.
|
50 |
):
|
51 |
args = PIPELINE_ARGS(temperature = max(0.2, float(temperature)), top_p = float(top_p),
|
52 |
alpha_frequency = countPenalty,
|
|
|
14 |
def generate_prompt(instruction, input=None):
|
15 |
instruction = instruction.strip().replace('\r\n','\n').replace('\n\n','\n').replace('\n\n','\n')
|
16 |
input = input.strip().replace('\r\n','\n').replace('\n\n','\n').replace('\n\n','\n')
|
17 |
+
if input and len(input) > 0:
|
18 |
return f"""Instruction: {instruction}
|
19 |
|
20 |
Input: {input}
|
|
|
44 |
input=None,
|
45 |
token_count=200,
|
46 |
temperature=1.0,
|
47 |
+
top_p=0.5,
|
48 |
+
presencePenalty = 0.4,
|
49 |
+
countPenalty = 0.4,
|
50 |
):
|
51 |
args = PIPELINE_ARGS(temperature = max(0.2, float(temperature)), top_p = float(top_p),
|
52 |
alpha_frequency = countPenalty,
|