Spaces:
Runtime error
Runtime error
generic reliability update 2
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ DEFAULT_PARAMS = {
|
|
24 |
"frequency_penalty": 0,
|
25 |
"presence_penalty": 0,
|
26 |
"repetition_penalty": 1.1,
|
27 |
-
"max_tokens":
|
28 |
}
|
29 |
|
30 |
def get_timestamp():
|
@@ -41,8 +41,9 @@ def predict(message, history, system_prompt, temperature, top_p, top_k, frequenc
|
|
41 |
history_format.append({"role": "assistant", "content": assistant})
|
42 |
history_format.append({"role": "user", "content": message})
|
43 |
|
44 |
-
|
45 |
-
|
|
|
46 |
|
47 |
current_params = {
|
48 |
"temperature": temperature,
|
@@ -56,7 +57,7 @@ def predict(message, history, system_prompt, temperature, top_p, top_k, frequenc
|
|
56 |
|
57 |
non_default_params = {k: v for k, v in current_params.items() if v != DEFAULT_PARAMS[k]}
|
58 |
|
59 |
-
if non_default_params:
|
60 |
for param, value in non_default_params.items():
|
61 |
print(f"{param}={value}")
|
62 |
|
|
|
24 |
"frequency_penalty": 0,
|
25 |
"presence_penalty": 0,
|
26 |
"repetition_penalty": 1.1,
|
27 |
+
"max_tokens": 512
|
28 |
}
|
29 |
|
30 |
def get_timestamp():
|
|
|
41 |
history_format.append({"role": "assistant", "content": assistant})
|
42 |
history_format.append({"role": "user", "content": message})
|
43 |
|
44 |
+
if not message.startswith(('*', '"')):
|
45 |
+
print(f"<|system|> {system_prompt}")
|
46 |
+
print(f"{get_timestamp()} <|user|> {message}")
|
47 |
|
48 |
current_params = {
|
49 |
"temperature": temperature,
|
|
|
57 |
|
58 |
non_default_params = {k: v for k, v in current_params.items() if v != DEFAULT_PARAMS[k]}
|
59 |
|
60 |
+
if non_default_params and not message.startswith(('*', '"')):
|
61 |
for param, value in non_default_params.items():
|
62 |
print(f"{param}={value}")
|
63 |
|