Skip to content

Commit 3ce3b18

Browse files
authored
Merge pull request #225 from Dartvauder/dev
Update app.py
2 parents 5ab80fc + 3965f85 commit 3ce3b18

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

LaunchFile/app.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ def wrapper():
228228
pass
229229
print("Xformers is not installed. Proceeding without it")
230230

231+
chat_history = None
231232
chat_dir = None
232233
tts_model = None
233234
whisper_model = None
@@ -1035,7 +1036,7 @@ def image_to_base64_data_uri(image_path):
10351036

10361037
text = ""
10371038
if not chat_history or chat_history[-1][1] is not None:
1038-
chat_history.append([prompt, ""])
1039+
chat_history.append([prompt, text])
10391040

10401041
for i in range(max_length):
10411042

@@ -1074,7 +1075,7 @@ def image_to_base64_data_uri(image_path):
10741075
elif llm_model_type == "llama":
10751076
text = ""
10761077
if not chat_history or chat_history[-1][1] is not None:
1077-
chat_history.append([prompt, ""])
1078+
chat_history.append([prompt, text])
10781079

10791080
stop_sequences = [seq.strip() for seq in stopping.split(',')] if stopping.strip() else None
10801081

@@ -8611,7 +8612,7 @@ def reload_interface():
86118612
gr.Slider(minimum=1, maximum=200, value=40, step=1, label=_("Top K", lang)),
86128613
gr.Checkbox(label=_("Enable Do Sample", lang), value=False),
86138614
gr.Checkbox(label=_("Enable Early Stopping", lang), value=False),
8614-
gr.Textbox(label=_("Stop sequences (optional)", lang), value=""),
8615+
gr.Textbox(label=_("Stop sequences (optional)", lang), value="Human:"),
86158616
gr.Slider(minimum=0.1, maximum=2.0, value=1.0, step=0.1, label=_("Repetition penalty", lang)),
86168617
gr.Slider(minimum=0.1, maximum=2.0, value=0.0, step=0.1, label=_("Frequency penalty", lang)),
86178618
gr.Slider(minimum=0.1, maximum=2.0, value=0.0, step=0.1, label=_("Presence penalty", lang)),

0 commit comments

Comments
 (0)