diff --git a/demo_trt_llm/apply_patch.sh b/demo_trt_llm/apply_patch.sh index 63ed9220..7009bbab 100644 --- a/demo_trt_llm/apply_patch.sh +++ b/demo_trt_llm/apply_patch.sh @@ -7,7 +7,7 @@ FILE_PATH="/usr/local/lib/python3.10/dist-packages/tensorrt_llm/models/llama/con cp $FILE_PATH "${FILE_PATH}.bak" # Replace the strings -# sed -i ':a;N;$!ba;s|hf_config = LlavaConfig.from_pretrained(hf_model).text_config|hf_config = LlavaConfig.from_pretrained(hf_model).text_config\n if hf_config.model_type == "llava_llama":\n hf_config.llm_cfg["architecture"] = hf_config.llm_cfg["architectures"]\n hf_config.llm_cfg["dtype"] = hf_config.llm_cfg["torch_dtype"]\n hf_config = PretrainedConfig.from_dict(hf_config.llm_cfg)|g' $FILE_PATH +sed -i ':a;N;$!ba;s|hf_config = LlavaConfig.from_pretrained(hf_model).text_config|hf_config = LlavaConfig.from_pretrained(hf_model).text_config\n if hf_config.model_type == "llava_llama":\n hf_config.llm_cfg["architecture"] = hf_config.llm_cfg["architectures"]\n hf_config.llm_cfg["dtype"] = hf_config.llm_cfg["torch_dtype"]\n hf_config = PretrainedConfig.from_dict(hf_config.llm_cfg)|g' $FILE_PATH sed -i ':a;N;$!ba;s|if "vila" in model_dir:\n sys.path.append(model_dir + "/../VILA")\n from llava.model import LlavaConfig, LlavaLlamaForCausalLM\n AutoConfig.register("llava_llama", LlavaConfig)\n AutoModelForCausalLM.register(LlavaConfig, LlavaLlamaForCausalLM)|# if "vila" in model_dir:\n# sys.path.append(model_dir + "/../VILA")\n# from llava.model import LlavaConfig, LlavaLlamaForCausalLM\n# AutoConfig.register("llava_llama", LlavaConfig)\n# AutoModelForCausalLM.register(LlavaConfig, LlavaLlamaForCausalLM)|g' $FILE_PATH # Inform the user