dung-vpt-uney commited on
Commit
b20455d
·
1 Parent(s): 9233720

Update Visual-CoT demo - 2025-10-12 22:22:10

Browse files

Fixes:
- Fix LLaVA config registration error (compatibility with newer transformers)
- Update Gradio to latest version (security fixes)
- Auto-deployed via update script

Files changed (2) hide show
  1. llava/model/builder.py +3 -2
  2. requirements.txt +2 -2
llava/model/builder.py CHANGED
@@ -56,7 +56,8 @@ def load_pretrained_model(
56
  else:
57
  kwargs["torch_dtype"] = torch.bfloat16
58
 
59
- if "llava" in model_name.lower():
 
60
  # Load LLaVA model
61
 
62
  if "lora" in model_name.lower() and model_base is not None:
@@ -73,7 +74,7 @@ def load_pretrained_model(
73
 
74
  image_processor = None
75
 
76
- if "llava" in model_name.lower():
77
  mm_use_im_start_end = getattr(model.config, "mm_use_im_start_end", False)
78
  mm_use_im_patch_token = getattr(model.config, "mm_use_im_patch_token", True)
79
  if mm_use_im_patch_token:
 
56
  else:
57
  kwargs["torch_dtype"] = torch.bfloat16
58
 
59
+ # Check if model is LLaVA-based (including VisCoT which is built on LLaVA)
60
+ if "llava" in model_name.lower() or "viscot" in model_name.lower():
61
  # Load LLaVA model
62
 
63
  if "lora" in model_name.lower() and model_base is not None:
 
74
 
75
  image_processor = None
76
 
77
+ if "llava" in model_name.lower() or "viscot" in model_name.lower():
78
  mm_use_im_start_end = getattr(model.config, "mm_use_im_start_end", False)
79
  mm_use_im_patch_token = getattr(model.config, "mm_use_im_patch_token", True)
80
  if mm_use_im_patch_token:
requirements.txt CHANGED
@@ -8,8 +8,8 @@ transformers==4.37.2
8
  tokenizers==0.15.1
9
  sentencepiece==0.1.99
10
 
11
- # Gradio and Spaces (use stable version compatible with Spaces)
12
- gradio==4.36.0 # Stable version without breaking changes
13
  spaces>=0.19.4
14
 
15
  # Model dependencies
 
8
  tokenizers==0.15.1
9
  sentencepiece==0.1.99
10
 
11
+ # Gradio and Spaces (use latest version)
12
+ gradio # Latest version with all security updates
13
  spaces>=0.19.4
14
 
15
  # Model dependencies