From 0c7149deb3fc18e7d6c45d575fa2626aef1b6ac6 Mon Sep 17 00:00:00 2001 From: Wei-Ming Chen Date: Wed, 8 May 2024 00:01:02 -0700 Subject: [PATCH] Update apply_patch.sh Fix patch script --- demo_trt_llm/apply_patch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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