Spaces:
Running
Running
Staticaliza
commited on
Commit
•
37ba605
1
Parent(s):
d43bb55
Update app.py
Browse files
app.py
CHANGED
@@ -29,9 +29,8 @@ for model_name, model_endpoint in API_ENDPOINTS.items():
|
|
29 |
|
30 |
def format(instruction = DEFAULT_INSTRUCTION, history = [], input = "", preoutput = ""):
|
31 |
sy_l, sy_r = SPECIAL_SYMBOLS[0], SPECIAL_SYMBOLS[1]
|
32 |
-
formatted_history =
|
33 |
-
formatted_input = f"{sy_l}System: {instruction}{sy_r}{formatted_history}
|
34 |
-
print(formatted_input)
|
35 |
return formatted_input
|
36 |
|
37 |
def predict(instruction, history, input, preoutput, access_key, model, temperature, top_p, top_k, rep_p, max_tokens, stop_seqs, seed):
|
@@ -58,7 +57,6 @@ def predict(instruction, history, input, preoutput, access_key, model, temperatu
|
|
58 |
details = False,
|
59 |
return_full_text = False
|
60 |
)
|
61 |
-
print(response)
|
62 |
|
63 |
sy_l, sy_r = SPECIAL_SYMBOLS[0], SPECIAL_SYMBOLS[1]
|
64 |
pre_result = f"{sy_l}{response}{sy_r}{''.join(SPECIAL_SYMBOLS)}"
|
|
|
29 |
|
30 |
def format(instruction = DEFAULT_INSTRUCTION, history = [], input = "", preoutput = ""):
|
31 |
sy_l, sy_r = SPECIAL_SYMBOLS[0], SPECIAL_SYMBOLS[1]
|
32 |
+
formatted_history = "".join(f"{sy_l}{message[0]}{sy_r}\n{sy_l}{message[1]}{sy_r}\n" for message in history)
|
33 |
+
formatted_input = f"{sy_l}System: {instruction}{sy_r}\n{formatted_history}{sy_l}{input}{sy_r}\n{sy_l}{preoutput}"
|
|
|
34 |
return formatted_input
|
35 |
|
36 |
def predict(instruction, history, input, preoutput, access_key, model, temperature, top_p, top_k, rep_p, max_tokens, stop_seqs, seed):
|
|
|
57 |
details = False,
|
58 |
return_full_text = False
|
59 |
)
|
|
|
60 |
|
61 |
sy_l, sy_r = SPECIAL_SYMBOLS[0], SPECIAL_SYMBOLS[1]
|
62 |
pre_result = f"{sy_l}{response}{sy_r}{''.join(SPECIAL_SYMBOLS)}"
|