0
$\begingroup$

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.

  1. model = pipeline.model This resulted in

    AttributeError: 'LlamaForCausalLM' object has no attribute 'bind_tools'

  2. 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.

$\endgroup$

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.