Skip to content

Commit

Permalink
Merge pull request #225 from Dartvauder/dev
Browse files Browse the repository at this point in the history
Update app.py
  • Loading branch information
Dartvauder authored Sep 28, 2024
2 parents 5ab80fc + 3965f85 commit 3ce3b18
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 3ce3b18

Please sign in to comment.