Taiwan-LLM icon indicating copy to clipboard operation
Taiwan-LLM copied to clipboard

Llama-3-Taiwan-8B-Instruct是否支援LangChain Tools

Open Hsun1128 opened this issue 4 months ago • 0 comments

目前使用 vllm 的方式運行8B模型

export NUM_GPUS=1
export PORT=8000

docker run \
  -e HF_TOKEN=$HF_TOKEN \
  --gpus all \
  -v ~/.cache/huggingface:/root/.cache/huggingface \
  -p "${PORT}:8000" \
  --ipc=host \
  vllm/vllm-openai:v0.4.0.post1 \
  --model "yentinglin/Llama-3-Taiwan-8B-Instruct" \
  -tp "${NUM_GPUS}"

然後使用LangChain 提供的連接vllm的方法連接 llm

from langchain_openai import ChatOpenAI

model_id = "yentinglin/Llama-3-Taiwan-8B-Instruct"
inference_server_url = "http://localhost:8000/v1"

llm = ChatOpenAI(
    model=model_id,
    openai_api_key="EMPTY",
    openai_api_base=inference_server_url,
    temperature=0,
    streaming=True,
)

接著參考官方的教學文件試做,但卻一直得不到 tool_calls,所以想請教您該模型是否支援 LangChain Tools 的用法,以及該問題的解決方法,還請您不吝指教,謝謝。

參考連結https://langchain-ai.github.io/langgraph/how-tos/pass-run-time-values-to-tools/#define-the-nodes

Hsun1128 avatar Oct 03 '24 14:10 Hsun1128