Skip to content

Commit

Permalink
Fix file paths and scaling factor calculation in video_demo.py and vi…
Browse files Browse the repository at this point in the history
…deo_demo.sh
  • Loading branch information
ZhangYuanhan-AI committed May 10, 2024
1 parent 7a709aa commit 9496e2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion playground/demo/video_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,10 @@ def run_inference(args):
least_token_number = args.for_get_frames_num*(24//args.mm_spatial_pool_stride)**2 + 1000

scaling_factor = math.ceil(least_token_number/4096)
# import pdb;pdb.set_trace()

if scaling_factor >= 2:
if "vicuna" in cfg_pretrained._name_or_path.lower():
if "mistral" not in cfg_pretrained._name_or_path.lower() and "7b" in cfg_pretrained._name_or_path.lower():
print(float(scaling_factor))
overwrite_config["rope_scaling"] = {"factor": float(scaling_factor), "type": "linear"}
overwrite_config["max_sequence_length"] = 4096 * scaling_factor
Expand Down
2 changes: 1 addition & 1 deletion scripts/video/demo/video_demo.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
ROOT_DIR="/mnt/bn/vl-research/workspace/yhzhang/llava-next-video"
ROOT_DIR="/mnt/bn/vl-research/workspace/yhzhang/LLaVA-NeXT"

if [ ! -e $ROOT_DIR ]; then
echo "The root dir does not exist. Exiting the script."
Expand Down

0 comments on commit 9496e2d

Please sign in to comment.