Update app.py
Browse files39 unmodified lines40414243444549 unmodified lines959697989910092 unmodified lines19319419519619719819939 unmodified linesreturn model_context_limits.get(model_name, None)def get_messages_formatter_type(model_name):model_name = model_name.lower()if "mistral" in model_name:return MessagesFormatterType.MISTRAL49 unmodified linestop_k,repeat_penalty,):global llmglobal llm_modelchat_template = get_messages_formatter_type(model)92 unmodified linesgr.Dropdown(['Mistral-7B-Instruct-v0.3'],value="Mistral-7B-Instruct-v0.3",label="Model"),gr.Textbox(value=web_search_system_prompt, label="System message"),39 unmodified lines4041424344454647484949 unmodified lines9910010110210310410510610710892 unmodified lines20120220320420520620739 unmodified linesreturn model_context_limits.get(model_name, None)def get_messages_formatter_type(model_name):if model_name is None:logging.warning("Model name is None. Defaulting to CHATML formatter.")return MessagesFormatterType.CHATMLmodel_name = model_name.lower()if "mistral" in model_name:return MessagesFormatterType.MISTRAL49 unmodified linestop_k,repeat_penalty,):if model is None:logging.error("Model is None. Please select a valid model.")return "Error: No model selected. Please choose a valid model."global llmglobal llm_modelchat_template = get_messages_formatter_type(model)92 unmodified linesgr.Dropdown(['Mistral-7B-Instruct-v0.3'],value="Mistral-7B-Instruct-v0.3", # This should match exactlylabel="Model"),gr.Textbox(value=web_search_system_prompt, label="System message"),
app.py+9-1