Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

community[docs]: Add content for the Lora adapter in the VLLM page. #27788

Merged
merged 10 commits into from
Oct 31, 2024
29 changes: 29 additions & 0 deletions docs/docs/integrations/llms/vllm.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,35 @@
")\n",
"print(llm.invoke(\"Rome is\"))"
]
},
{
"cell_type": "markdown",
"id": "bd3f0f51",
"metadata": {},
"source": [
"## LoRA adapter\n",
"LoRA adapters can be used with any vLLM model that implements `SupportsLoRA`."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2682ca6c",
"metadata": {},
"outputs": [],
"source": [
"from langchain_community.llms import VLLM\n",
"from vllm.lora.request import LoRARequest\n",
"\n",
"llm = VLLM(model=\"meta-llama/Llama-2-7b-hf\", enable_lora=True)\n",
"\n",
"LoRA_ADAPTER_PATH = \"path/to/adapter\"\n",
"lora_adapter = LoRARequest(\"lora_adapter\", 1, LoRA_ADAPTER_PATH)\n",
"\n",
"print(\n",
" llm.invoke(\"What are some popular Korean street foods?\", lora_request=lora_adapter)\n",
")"
]
}
],
"metadata": {
Expand Down
Loading