Could not load model medalpaca/medalpaca-7b with any of the following classes

#6
by Zubinbalsara - opened

I tired to run the medalpaca -7b on sagemaker lab and getting the following errors. Can someone please help me

Could not load model medalpaca/medalpaca-7b with any of the following classes: (<class 'transformers.models.auto.modeling_auto.AutoModelForCausalLM'>, <class 'transformers.models.llama.modeling_llama.LlamaForCausalLM'>).

ValueError Traceback (most recent call last)
/tmp/ipykernel_154/4213711743.py in <cell line: 1>()
----> 1 pl = pipeline("text-generation", model="medalpaca/medalpaca-7b", tokenizer="medalpaca/medalpaca-7b")
2 question = "What are the symptoms of diabetes?"
3 context = "Diabetes is a metabolic disease that causes high blood sugar. The symptoms include increased thirst, frequent urination, and unexplained weight loss."
4 answer = pl(f"Context: {context}\n\nQuestion: {question}\n\nAnswer: ")
5 print(answer)

~/.conda/envs/default/lib/python3.9/site-packages/transformers/pipelines/init.py in pipeline(task, model, config, tokenizer, feature_extractor, image_processor, framework, revision, use_fast, use_auth_token, device, device_map, torch_dtype, trust_remote_code, model_kwargs, pipeline_class, **kwargs)
786 if isinstance(model, str) or framework is None:
787 model_classes = {"tf": targeted_task["tf"], "pt": targeted_task["pt"]}
--> 788 framework, model = infer_framework_load_model(
789 model,
790 model_classes=model_classes,

~/.conda/envs/default/lib/python3.9/site-packages/transformers/pipelines/base.py in infer_framework_load_model(model, config, model_classes, task, framework, **model_kwargs)
276
277 if isinstance(model, str):
--> 278 raise ValueError(f"Could not load model {model} with any of the following classes: {class_tuple}.")
279
280 if framework is None:

ValueError: Could not load model medalpaca/medalpaca-7b with any of the following classes: (<class 'transformers.models.auto.modeling_auto.AutoModelForCausalLM'>, <class 'transformers.models.llama.modeling_llama.LlamaForCausalLM'>).

Sign up or log in to comment