|
|
|
@ -90,7 +90,7 @@
|
|
|
|
|
"device = \"CPU\"\n",
|
|
|
|
|
"tokenizer = AutoTokenizer.from_pretrained(model_id)\n",
|
|
|
|
|
"ov_model = OVModelForCausalLM.from_pretrained(\n",
|
|
|
|
|
" model_id, device=device, ov_config=ov_config\n",
|
|
|
|
|
" model_id, export=True, device=device, ov_config=ov_config\n",
|
|
|
|
|
")\n",
|
|
|
|
|
"ov_pipe = pipeline(\n",
|
|
|
|
|
" \"text-generation\", model=ov_model, tokenizer=tokenizer, max_new_tokens=10\n",
|
|
|
|
@ -185,11 +185,11 @@
|
|
|
|
|
" pipeline_kwargs={\"max_new_tokens\": 10},\n",
|
|
|
|
|
")\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"ov_chain = prompt | ov_llm\n",
|
|
|
|
|
"chain = prompt | ov_llm\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"question = \"What is electroencephalography?\"\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"print(ov_chain.invoke({\"question\": question}))"
|
|
|
|
|
"print(chain.invoke({\"question\": question}))"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
@ -229,7 +229,7 @@
|
|
|
|
|
"\n",
|
|
|
|
|
"* [OpenVINO Get Started Guide](https://www.intel.com/content/www/us/en/content-details/819067/openvino-get-started-guide.html).\n",
|
|
|
|
|
" \n",
|
|
|
|
|
"* [RAG Notebook with LangChain](https://github.com/openvinotoolkit/openvino_notebooks/tree/latest/notebooks/llm-chatbot)."
|
|
|
|
|
"* [RAG Notebook with LangChain](https://github.com/openvinotoolkit/openvino_notebooks/tree/latest/notebooks/llm-rag-langchain)."
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|