LangChain WIP; TypeError: _BaseAutoModelClass.from_pretrained() missing 1 required positional argument: 'pretrained_model_name_or_path'

This commit is contained in:
Adam Wilson
2025-05-14 19:33:47 -06:00
parent 92d5200edd
commit bddaa92c92

View File

@@ -17,7 +17,7 @@ class Llm:
model_path = os.path.join(base_dir, "phi3")
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(
model_id=model_path,
pretrained_model_name_or_path=model_path,
device_map="cpu", # Use available GPU
trust_remote_code=True, # If model requires custom code
)