|
@@ -9,7 +9,7 @@
|
|
|
"\n",
|
|
|
"LLMs abilities for reasoning (e.g. chain-of-thought CoT prompting) and acting have primarily been studied as separate topics. **ReAct** [Shunyu Yao et al. ICLR 2023](https://arxiv.org/pdf/2210.03629.pdf) (Reason and Act) is a method to generate both reasoning traces and task-specific actions in an interleaved manner.\n",
|
|
|
"\n",
|
|
|
- "In simple words, we define specific patterns for the language model to follow. This allows the model to act (usually through tools) and reason. Hence the model create a squence of interleaved thoughts and actions. Such systems that act on an enviroment are usually called **agents** (borrowed from reinforcement learning).\n",
|
|
|
+ "In simple words, we define specific patterns for the language model to follow. This allows the model to act (usually through tools) and reason. Hence the model creates a squence of interleaved thoughts and actions. Such systems that act on an enviroment are usually called **agents** (borrowed from reinforcement learning).\n",
|
|
|
"\n",
|
|
|
""
|
|
|
]
|
|
@@ -79,7 +79,7 @@
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 4,
|
|
|
+ "execution_count": null,
|
|
|
"metadata": {},
|
|
|
"outputs": [],
|
|
|
"source": [
|
|
@@ -87,7 +87,7 @@
|
|
|
"LLAMA2_13B_CHAT = \"meta.llama2-13b-chat-v1\"\n",
|
|
|
"\n",
|
|
|
"# We'll default to the smaller 13B model for speed; change to LLAMA2_70B_CHAT for more advanced (but slower) generations\n",
|
|
|
- "DEFAULT_MODEL = LLAMA2_70B_CHAT\n",
|
|
|
+ "DEFAULT_MODEL = LLAMA2_13B_CHAT\n",
|
|
|
"\n",
|
|
|
"llm = Bedrock(credentials_profile_name='default', model_id=DEFAULT_MODEL)"
|
|
|
]
|
|
@@ -451,7 +451,9 @@
|
|
|
],
|
|
|
"source": [
|
|
|
"response_observation = next_step(response)\n",
|
|
|
- "new_query = query + '\\033[32m\\033[1m' + response_observation\n",
|
|
|
+ "\n",
|
|
|
+ "# '\\033[32m\\033[1m' is the escape code to set the text that follows to be Bold Green\n",
|
|
|
+ "new_query = query + '\\033[32m\\033[1m' + response_observation \n",
|
|
|
"print(new_query)"
|
|
|
]
|
|
|
},
|
|
@@ -520,6 +522,7 @@
|
|
|
}
|
|
|
],
|
|
|
"source": [
|
|
|
+ "# '\\033[34m\\033[1m' is the escape code to set the text that follows to be Bold Blue\n",
|
|
|
"print(new_query + '\\033[34m\\033[1m' + response)"
|
|
|
]
|
|
|
},
|