Update app.py
Browse files18 unmodified lines1920212223242545 unmodified lines7172737475767778798081823 unmodified lines868788899091929318 unmodified lines}# Fixed system messageSYSTEM_MESSAGE = "Lake 1 Base"def respond(message,45 unmodified linesdef respond_with_pseudonym(message,history: list,selected_pseudonym,selected_preset):# Find the actual model name from the pseudonymmodel_name = next(model[0] for model in model_choices if model[1] == selected_pseudonym)# Call the existing respond functionresponse = 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 dropdowngr.Dropdown(choices=pseudonyms, label="Select Model", value=pseudonyms[0]) # Pseudonym selection dropdown],)18 unmodified lines1920212223242545 unmodified lines7172737475767778798081828384858687883 unmodified lines929394959697989910018 unmodified lines}# Fixed system messageSYSTEM_MESSAGE = "Your name is Lake 1 Base but my is User"def respond(message,45 unmodified linesdef respond_with_pseudonym(message,history: list,selected_model, # Change this to selected_modelselected_preset):print(f"Selected Model: {selected_model}") # Debugging lineprint(f"Available Models: {pseudonyms}") # Debugging line# Find the actual model name from the pseudonymtry: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 functionresponse = respond(message, history, model_name, selected_preset)3 unmodified linesdemo = gr.ChatInterface(fn=respond_with_pseudonym,additional_inputs=[gr.Dropdown(choices=pseudonyms, label="Select Model", value=pseudonyms[0]), # Pseudonym selection dropdowngr.Dropdown(choices=list(presets["mistralai/Mistral-7B-Instruct-v0.3"].keys()), label="Select Preset", value="Fast") # Preset selection dropdown],)
app.py+13-6