Upload folder using huggingface_hub
Browse files- api.py +1 -1
- 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 |
-
|
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
|