File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 6
6
7
7
class Hf (VannaBase ):
8
8
def __init__ (self , config = None ):
9
- model_name = self .config .get (
10
- "model_name" , None
11
- ) # e.g. meta-llama/Meta-Llama-3-8B-Instruct
12
- self .tokenizer = AutoTokenizer .from_pretrained (model_name )
9
+ model_name_or_path = self .config .get (
10
+ "model_name_or_path" , None
11
+ ) # e.g. meta-llama/Meta-Llama-3-8B-Instruct or local path to the model checkpoint files
12
+ # list of quantization methods supported by transformers package: https://huggingface.co/docs/transformers/main/en/quantization/overview
13
+ quantization_config = self .config .get ("quantization_config" , None )
14
+ self .tokenizer = AutoTokenizer .from_pretrained (model_name_or_path )
13
15
self .model = AutoModelForCausalLM .from_pretrained (
14
- model_name ,
15
- torch_dtype = "auto" ,
16
+ model_name_or_path ,
17
+ quantization_config = quantization_config ,
16
18
device_map = "auto" ,
17
19
)
18
20
You can’t perform that action at this time.
0 commit comments