zbing commited on
Commit
76b5d46
1 Parent(s): c88b0bd

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. api.py +1 -1
  2. requirements.txt +2 -1
api.py CHANGED
@@ -40,7 +40,7 @@ def fixed_get_imports(filename: str | os.PathLike) -> list[str]:
40
  return imports
41
 
42
  # Initialize the model and processor
43
- with patch("transformers.dynamic_module_utils.get_imports", fixed_get_imports): #workaround for unnecessary flash_attn requirement
44
  model = AutoModelForCausalLM.from_pretrained(args.model_path, attn_implementation="sdpa", torch_dtype=torch_dtype,trust_remote_code=True).to(device)
45
  processor = AutoProcessor.from_pretrained(args.model_path, trust_remote_code=True)
46
 
 
40
  return imports
41
 
42
  # Initialize the model and processor
43
+ with patch("transformers.dynamic_module_utils.get_imports", fixed_get_imports): #workaround for unnecessary flash_attn requirement
44
  model = AutoModelForCausalLM.from_pretrained(args.model_path, attn_implementation="sdpa", torch_dtype=torch_dtype,trust_remote_code=True).to(device)
45
  processor = AutoProcessor.from_pretrained(args.model_path, trust_remote_code=True)
46
 
requirements.txt CHANGED
@@ -4,4 +4,5 @@ einops
4
  spaces
5
  timm
6
  gradio
7
- transformers
 
 
4
  spaces
5
  timm
6
  gradio
7
+ transformers
8
+ torch