mirror of
https://github.com/hwchase17/langchain
synced 2024-11-18 09:25:54 +00:00
- **Description:** : As described in the issue below, https://python.langchain.com/docs/use_cases/summarization I've modified the Python code in the above notebook to perform well. I also modified the OpenAI LLM model to the latest version as shown below. `gpt-3.5-turbo-16k --> gpt-3.5-turbo-1106` This is because it seems to be a bit more responsive. - **Issue:** : #14066
This commit is contained in:
parent
3833882ab7
commit
03d6b94c29
@ -181,7 +181,7 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"We can use `chain_type=\"stuff\"`, especially if using larger context window models such as:\n",
|
"We can use `chain_type=\"stuff\"`, especially if using larger context window models such as:\n",
|
||||||
"\n",
|
"\n",
|
||||||
"* 16k token OpenAI `gpt-3.5-turbo-16k` \n",
|
"* 16k token OpenAI `gpt-3.5-turbo-1106` \n",
|
||||||
"* 100k token Anthropic [Claude-2](https://www.anthropic.com/index/claude-2)\n",
|
"* 100k token Anthropic [Claude-2](https://www.anthropic.com/index/claude-2)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"We can also supply `chain_type=\"map_reduce\"` or `chain_type=\"refine\"` (read more [here](/docs/modules/chains/document/refine))."
|
"We can also supply `chain_type=\"map_reduce\"` or `chain_type=\"refine\"` (read more [here](/docs/modules/chains/document/refine))."
|
||||||
@ -212,7 +212,7 @@
|
|||||||
"loader = WebBaseLoader(\"https://lilianweng.github.io/posts/2023-06-23-agent/\")\n",
|
"loader = WebBaseLoader(\"https://lilianweng.github.io/posts/2023-06-23-agent/\")\n",
|
||||||
"docs = loader.load()\n",
|
"docs = loader.load()\n",
|
||||||
"\n",
|
"\n",
|
||||||
"llm = ChatOpenAI(temperature=0, model_name=\"gpt-3.5-turbo-16k\")\n",
|
"llm = ChatOpenAI(temperature=0, model_name=\"gpt-3.5-turbo-1106\")\n",
|
||||||
"chain = load_summarize_chain(llm, chain_type=\"stuff\")\n",
|
"chain = load_summarize_chain(llm, chain_type=\"stuff\")\n",
|
||||||
"\n",
|
"\n",
|
||||||
"chain.run(docs)"
|
"chain.run(docs)"
|
||||||
@ -672,7 +672,7 @@
|
|||||||
"summarize_document_chain = AnalyzeDocumentChain(\n",
|
"summarize_document_chain = AnalyzeDocumentChain(\n",
|
||||||
" combine_docs_chain=chain, text_splitter=text_splitter\n",
|
" combine_docs_chain=chain, text_splitter=text_splitter\n",
|
||||||
")\n",
|
")\n",
|
||||||
"summarize_document_chain.run(docs[0])"
|
"summarize_document_chain.run(docs[0].page_content)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user