File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 9
9
from pathlib import Path
10
10
from typing import Any , Dict , Optional
11
11
12
+
12
13
def get_default_model_resource_dir () -> str :
13
14
"""
14
15
Get the default path to resouce files (which contain files such as the
@@ -18,10 +19,11 @@ def get_default_model_resource_dir() -> str:
18
19
"""
19
20
20
21
try :
22
+ import pkg_resources
23
+
21
24
# 2nd way: If we can import this path, we are running with buck2 and all resources can be accessed with pkg_resources.
22
25
# pyre-ignore
23
- import pgk_resources
24
- from executorch .examples .models .llama2 import params
26
+ from executorch .examples .models .llama2 import params # noqa
25
27
26
28
ckpt_dir = Path (
27
29
pkg_resources .resource_filename (
@@ -32,7 +34,8 @@ def get_default_model_resource_dir() -> str:
32
34
# 3rd way.
33
35
ckpt_dir = Path (__file__ ).absolute ().parent / "params"
34
36
35
- return ckpt_dir
37
+ return ckpt_dir
38
+
36
39
37
40
def get_checkpoint_dtype (checkpoint : Dict [str , Any ]) -> Optional [str ]:
38
41
dtype = None
Original file line number Diff line number Diff line change @@ -313,4 +313,3 @@ def _transform_for_pre_quantization(self, checkpoint):
313
313
int (embedding_bit_width ),
314
314
embedding_group_size ,
315
315
)
316
-
You can’t perform that action at this time.
0 commit comments