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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -12,8 +12,8 @@ from unittest.mock import patch
12
  from transformers.dynamic_module_utils import get_imports
13
 
14
  def fixed_get_imports(filename: str | os.PathLike) -> list[str]:
15
- #if not str(filename).endswith("/modeling_phi3.py"):
16
- # return get_imports(filename)
17
  imports = get_imports(filename)
18
  imports.remove("flash_attn")
19
  return imports
@@ -25,15 +25,15 @@ with patch("transformers.dynamic_module_utils.get_imports", fixed_get_imports):
25
  model_path,
26
  torch_dtype = torch.bfloat16,
27
  low_cpu_mem_usage = True,
28
- use_flash_attn = True,
29
  trust_remote_code = True
30
  ).eval().cuda()
31
 
32
- tokenizer = AutoTokenizer.from_pretrained(
33
- model_path,
34
- trust_remote_code = True,
35
- use_fast = False
36
- )
37
 
38
  def image_vision(image_input_path, prompt):
39
  image_path = image_input_path
 
12
  from transformers.dynamic_module_utils import get_imports
13
 
14
  def fixed_get_imports(filename: str | os.PathLike) -> list[str]:
15
+ if not str(filename).endswith("modeling_phi3.py"):
16
+ return get_imports(filename)
17
  imports = get_imports(filename)
18
  imports.remove("flash_attn")
19
  return imports
 
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,
34
+ trust_remote_code = True,
35
+ use_fast = False
36
+ )
37
 
38
  def image_vision(image_input_path, prompt):
39
  image_path = image_input_path