Skip to content

Commit

Permalink
update langchain agent with qwen2.5 for better accuracy (#2542)
Browse files Browse the repository at this point in the history
  • Loading branch information
openvino-dev-samples and eaidova authored Nov 22, 2024
1 parent 73d50d3 commit 5a32b8c
Show file tree
Hide file tree
Showing 6 changed files with 188 additions and 140 deletions.
3 changes: 2 additions & 1 deletion .ci/ignore_treon_docker.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,5 @@ notebooks/mllama-3.2/mllama-3.2.ipynb
notebooks/sam2-image-segmentation/segment-anything-2-image.ipynb
notebooks/pixtral/pixtral.ipynb
notebooks/llm-agent-react/llm-agent-react.ipynb
notebooks/multilora-image-generation/multilora-image-generation.ipynb
notebooks/multilora-image-generation/multilora-image-generation.ipynb
notebooks/llm-agent-react/llm-agent-react-langchain.ipynb
9 changes: 8 additions & 1 deletion .ci/skipped_notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -555,4 +555,11 @@
- notebook: notebooks/mobileclip-video-search/mobileclip-video-search.ipynb
skips:
- os:
- macos-12
- macos-12
- notebook: notebooks/llm-agent-react/llm-agent-react-langchain.ipynb
skips:
- os:
- macos-12
- ubuntu-20.04
- ubuntu-22.04
- windows-2019
2 changes: 1 addition & 1 deletion notebooks/llm-agent-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ LLM are limited to the knowledge on which they have been trained and the additio

The core idea of agents is to use a language model to choose a sequence of actions to take. In agents, a language model is used as a reasoning engine to determine which actions to take and in which order. Agents can be seen as applications powered by LLMs and integrated with a set of tools like search engines, databases, websites, and so on. Within an agent, the LLM is the reasoning engine that, based on the user input, is able to plan and execute a set of actions that are needed to fulfill the request.

![agent ui](https://github.com/openvinotoolkit/openvino_notebooks/assets/91237924/2abb2389-e612-4599-82c6-64cdac259120)
![image](https://github.com/user-attachments/assets/b656adab-a448-4784-a6df-a068e0cb45bb)

This notebook explores how to create an ReAct Agent step by step using OpenVINO. [ReAct](https://arxiv.org/abs/2210.03629) is an approach to combine reasoning (e.g. chain-of-thought prompting) and acting. ReAct overcomes issues of hallucination and error propagation prevalent in chain-of-thought reasoning by interacting with a simple Wikipedia API, and generates human-like task-solving trajectories that are more interpretable than baselines without reasoning traces.

Expand Down
2 changes: 1 addition & 1 deletion notebooks/llm-agent-react/gradio_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def make_demo(run_fn: Callable, stop_fn: Callable):
css=".disclaimer {font-variant-caps: all-small-caps;}",
) as demo:
gr.Markdown(f"""<h1><center>AI Agent with OpenVINO and LangChain</center></h1>""")
chatbot = gr.Chatbot(height=500)
chatbot = gr.Chatbot(height=800)
with gr.Row():
with gr.Column():
msg = gr.Textbox(
Expand Down
2 changes: 1 addition & 1 deletion notebooks/llm-agent-react/llm-agent-rag-llamaindex.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
},
{
"cell_type": "code",
"execution_count": 49,
"execution_count": null,
"id": "86fdc4ba-74c4-4869-898e-131f47827e8f",
"metadata": {
"test_replace": {}
Expand Down
Loading

0 comments on commit 5a32b8c

Please sign in to comment.