Skip to content

Commit

Permalink
Update apply_patch.sh
Browse files Browse the repository at this point in the history
Fix patch script
  • Loading branch information
meenchen authored May 8, 2024
1 parent 2a8bb83 commit 0c7149d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion demo_trt_llm/apply_patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0c7149d

Please sign in to comment.