Skip to content

Commit

Permalink
Update app.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Dartvauder committed Sep 28, 2024
1 parent 86e3c1a commit 3965f85
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions LaunchFile/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ def wrapper():
pass
print("Xformers is not installed. Proceeding without it")

chat_history = None
chat_dir = None
tts_model = None
whisper_model = None
Expand Down Expand Up @@ -1035,7 +1036,7 @@ def image_to_base64_data_uri(image_path):

text = ""
if not chat_history or chat_history[-1][1] is not None:
chat_history.append([prompt, ""])
chat_history.append([prompt, text])

for i in range(max_length):

Expand Down Expand Up @@ -1074,7 +1075,7 @@ def image_to_base64_data_uri(image_path):
elif llm_model_type == "llama":
text = ""
if not chat_history or chat_history[-1][1] is not None:
chat_history.append([prompt, ""])
chat_history.append([prompt, text])

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

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

0 comments on commit 3965f85

Please sign in to comment.