Procházet zdrojové kódy

update based on PR feedback

Jeff Tang před 5 měsíci
rodič
revize
e680762785

+ 2 - 1
recipes/use_cases/LiveData.ipynb

@@ -23,7 +23,8 @@
     "!pip install llama-index-core\n",
     "!pip install llama-index-llms-replicate\n",
     "!pip install llama-index-embeddings-huggingface\n",
-    "!pip install tavily-python"
+    "!pip install tavily-python\n",
+    "!pip install replicate"
    ]
   },
   {

+ 4 - 2
recipes/use_cases/VideoSummary.ipynb

@@ -32,7 +32,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "!pip install langchain youtube-transcript-api tiktoken pytube"
+    "!pip install langchain youtube-transcript-api tiktoken pytube replicate"
    ]
   },
   {
@@ -260,7 +260,7 @@
     "2. Loop over each subsequent sub-document, pass the previous summary with the current sub-document to generate a refined new summary;\n",
     "3. Return the final summary generated on the final sub-document as the final answer - the summary of the whole content.\n",
     "\n",
-    "An example prompt template for each call in step 2 is:\n",
+    "An example prompt template for each call in step 2, which gets used under the hood by LangChain, is:\n",
     "```\n",
     "Your job is to produce a final summary.\n",
     "We have provided an existing summary up to a certain point:\n",
@@ -279,6 +279,8 @@
    "metadata": {},
    "outputs": [],
    "source": [
+    "from langchain.chains.summarize import load_summarize_chain\n",
+    "\n",
     "chain = load_summarize_chain(llm, chain_type=\"refine\")\n",
     "chain.run(split_docs)"
    ]