I downloaded the weights of a llama model from huggingface. It works for simple tasks, but I don't know how to use it with langgraph to create agents or how to bind tools.
Here is how I downloaded it:
model_id = "meta-llama/Llama-3.2-3B-Instruct"
pipeline = transformers.pipeline(
"text-generation",
model=model_id,
token="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",
model_kwargs={"dtype": torch.bfloat16},
device_map="auto",
)
The code I try to use with this, is the example code (full code) on page: https://docs.langchain.com/oss/python/langgraph/quickstart#full-code-example
For the model variable I tried different things already.
model = pipeline.model This resulted in
AttributeError: 'LlamaForCausalLM' object has no attribute 'bind_tools'
Using Wrappers like ChatOpenAI and ChatOllama does not work for me, because it looks like these classes alreays assume the model is called using a REST API, but I want to use instances of the model directly to be able to make use of my CUDA system
Any suggestions are welcome.