fffiloni commited on
Commit
bd85948
·
verified ·
1 Parent(s): 6207473

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -8,6 +8,7 @@ import gradio as gr
8
  # Load the model and tokenizer
9
  model_path = "ByteDance/Sa2VA-4B"
10
 
 
11
  from unittest.mock import patch
12
  from transformers.dynamic_module_utils import get_imports
13
 
@@ -20,14 +21,14 @@ def fixed_get_imports(filename: str | os.PathLike) -> list[str]:
20
 
21
 
22
  with patch("transformers.dynamic_module_utils.get_imports", fixed_get_imports):
23
-
24
- model = AutoModel.from_pretrained(
25
- model_path,
26
- torch_dtype = torch.bfloat16,
27
- low_cpu_mem_usage = True,
28
- use_flash_attn = False,
29
- trust_remote_code = True
30
- ).eval().cuda()
31
 
32
  tokenizer = AutoTokenizer.from_pretrained(
33
  model_path,
 
8
  # Load the model and tokenizer
9
  model_path = "ByteDance/Sa2VA-4B"
10
 
11
+ """
12
  from unittest.mock import patch
13
  from transformers.dynamic_module_utils import get_imports
14
 
 
21
 
22
 
23
  with patch("transformers.dynamic_module_utils.get_imports", fixed_get_imports):
24
+ """
25
+ model = AutoModel.from_pretrained(
26
+ model_path,
27
+ torch_dtype = torch.bfloat16,
28
+ low_cpu_mem_usage = False,
29
+ use_flash_attn = False,
30
+ trust_remote_code = True
31
+ ).eval().cuda()
32
 
33
  tokenizer = AutoTokenizer.from_pretrained(
34
  model_path,