Update app.py
Browse files18 unmodified lines192021222223242545 unmodified lines7172737474757677787980787981828384858687883 unmodified lines9293948990959697989910018 unmodified lines}
# Fixed system messageSYSTEM_MESSAGE = "Lake 1 Base"SYSTEM_MESSAGE = "Your name is Lake 1 Base but my is User"
def respond( message,45 unmodified linesdef respond_with_pseudonym( message, history: list, selected_pseudonym, selected_model, # Change this to selected_model selected_preset): print(f"Selected Model: {selected_model}") # Debugging line print(f"Available Models: {pseudonyms}") # Debugging line
# Find the actual model name from the pseudonym model_name = next(model[0] for model in model_choices if model[1] == selected_pseudonym) try: model_name = next(model[0] for model in model_choices if model[1] == selected_model) except StopIteration: return f"Error: The selected model '{selected_model}' is not valid. Please select a valid model."
# Call the existing respond function response = respond(message, history, model_name, selected_preset) 3 unmodified linesdemo = gr.ChatInterface( fn=respond_with_pseudonym, additional_inputs=[ gr.Dropdown(choices=list(presets["mistralai/Mistral-7B-Instruct-v0.3"].keys()), label="Select Preset", value="Fast"), # Preset selection dropdown gr.Dropdown(choices=pseudonyms, label="Select Model", value=pseudonyms[0]) # Pseudonym selection dropdown gr.Dropdown(choices=pseudonyms, label="Select Model", value=pseudonyms[0]), # Pseudonym selection dropdown gr.Dropdown(choices=list(presets["mistralai/Mistral-7B-Instruct-v0.3"].keys()), label="Select Preset", value="Fast") # Preset selection dropdown ],)
app.py+13-6