GithubHelp home page GithubHelp logo

benman1 / generative_ai_with_langchain Goto Github PK

View Code? Open in Web Editor NEW
509.0 509.0 204.0 3.96 MB

Build large language model (LLM) apps with Python, ChatGPT and other models. This is the companion repository for the book on generative AI with LangChain.

Home Page: https://amzn.to/43PuIkQ

License: MIT License

Dockerfile 0.13% Jupyter Notebook 90.40% Python 8.66% HTML 0.76% Makefile 0.06%
chatgpt gpt huggingface langchain llms openai

generative_ai_with_langchain's Introduction

generative_ai_with_langchain's People

Contributors

benman1 avatar bhadreshpsavani avatar kushal499 avatar mekasone avatar mrchaos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

generative_ai_with_langchain's Issues

Issue with Conda create env command

I get the following error when I am trying to create Conda Env:

(base) C:\Users\rnema\Downloads\generative_ai_with_langchain-main>conda env create --file langchain_ai.yaml --force
Collecting package metadata (repodata.json): done
Solving environment: failed

ResolvePackageNotFound:

  • readline=8.2
  • ncurses=6.4

I am using Anaconda on Windows 11. I have the Anconda Command Prompt as an Administrator.

Pydantic format error

Hi,

While trying to run the Openresume CV example, I am getting the following error:

"RuntimeError: no validator found for <class 'main.Resume'>, see arbitrary_types_allowed in Config"

I managed to perform a small hack by enabling arbitrary types as a decorator on top of each class (@pydantic.dataclasses.dataclass(config=Config), where Config is a class that sets arbitrary_types_allowed = True). However this seems to run into parsing errors where the data type is not correct.

Any ideas? Thanks in advance!

chat_with_retrieval not running

Hello,
I am trying to use the scripts in the chat_with_retrieval folder .
Created a python environment with requirements. Unfortunatelly the streamlit app is crashing (please see the attached image).
I also listing the console output:

(generative_ai_with_langchain-env) c0274@c0274-i7:~/generative_ai_with_langchain/chat_with_retrieval$ streamlit run app.py

You can now view your Streamlit app in your browser.

Local URL: http://localhost:8501
Network URL: http://192.168.1.23:8501

INFO:root:[Document(page_content='Madam Speaker, ...
...
metadata={'source': '/tmp/tmpa4gyz1pv/state_of_the_union.txt'})]
2024-05-13 18:23:37.354 Uncaught app exception
Traceback (most recent call last):
File "/home/c0274/generative_ai_with_langchain/generative_ai_with_langchain-env/lib/python3.10/site-packages/langchain/vectorstores/docarray/base.py", line 19, in _check_docarray_import
import docarray
File "/home/c0274/generative_ai_with_langchain/generative_ai_with_langchain-env/lib/python3.10/site-packages/docarray/init.py", line 5, in
from docarray.array import DocList, DocVec
File "/home/c0274/generative_ai_with_langchain/generative_ai_with_langchain-env/lib/python3.10/site-packages/docarray/array/init.py", line 1, in
from docarray.array.any_array import AnyDocArray
File "/home/c0274/generative_ai_with_langchain/generative_ai_with_langchain-env/lib/python3.10/site-packages/docarray/array/any_array.py", line 22, in
from docarray.base_doc import BaseDoc
File "/home/c0274/generative_ai_with_langchain/generative_ai_with_langchain-env/lib/python3.10/site-packages/docarray/base_doc/init.py", line 1, in
from docarray.base_doc.any_doc import AnyDoc
File "/home/c0274/generative_ai_with_langchain/generative_ai_with_langchain-env/lib/python3.10/site-packages/docarray/base_doc/any_doc.py", line 3, in
from .doc import BaseDoc
File "/home/c0274/generative_ai_with_langchain/generative_ai_with_langchain-env/lib/python3.10/site-packages/docarray/base_doc/doc.py", line 22, in
from pydantic.main import ROOT_KEY
ImportError: cannot import name 'ROOT_KEY' from 'pydantic.main' (/home/c0274/generative_ai_with_langchain/generative_ai_with_langchain-env/lib/python3.10/site-packages/pydantic/main.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/c0274/generative_ai_with_langchain/generative_ai_with_langchain-env/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 600, in _run_script
exec(code, module.dict)
File "/home/c0274/generative_ai_with_langchain/chat_with_retrieval/app.py", line 35, in
CONV_CHAIN = configure_retrieval_chain(
File "/home/c0274/generative_ai_with_langchain/chat_with_retrieval/chat_with_documents.py", line 108, in configure_retrieval_chain
retriever = configure_retriever(docs=docs, use_compression=use_compression)
File "/home/c0274/generative_ai_with_langchain/chat_with_retrieval/chat_with_documents.py", line 47, in configure_retriever
vectordb = DocArrayInMemorySearch.from_documents(splits, embeddings)
File "/home/c0274/generative_ai_with_langchain/generative_ai_with_langchain-env/lib/python3.10/site-packages/langchain/vectorstores/base.py", line 417, in from_documents
return cls.from_texts(texts, embedding, metadatas=metadatas, **kwargs)
File "/home/c0274/generative_ai_with_langchain/generative_ai_with_langchain-env/lib/python3.10/site-packages/langchain/vectorstores/docarray/in_memory.py", line 67, in from_texts
store = cls.from_params(embedding, **kwargs)
File "/home/c0274/generative_ai_with_langchain/generative_ai_with_langchain-env/lib/python3.10/site-packages/langchain/vectorstores/docarray/in_memory.py", line 38, in from_params
_check_docarray_import()
File "/home/c0274/generative_ai_with_langchain/generative_ai_with_langchain-env/lib/python3.10/site-packages/langchain/vectorstores/docarray/base.py", line 29, in _check_docarray_import
raise ImportError(
ImportError: Could not import docarray python package. Please install it with pip install "langchain[docarray]".

Any clue is very welcome.
langchain[docarray] is already installed .
Screenshot from 2024-05-13 18-19-46

Chapter 3, Hugging Face Transformers

Starting from page 86, the following example is shown

from transformers import pipeline
import torch
generate_text = pipeline(
model="aisquared/dlite-v1-355m",
torch_dtype=torch.bfloat16,
trust_remote_code=True,
device_map="auto",
framework="pt"
)
generate_text("In this chapter, we'll discuss first steps with generative
AI in Python.")

Followed up with the following code block utilizing PromptTemplate and LLMChains:

from langchain import PromptTemplate, LLMChain
template = """Question: {question}
Answer: Let's think step by step."""
prompt = PromptTemplate(template=template, input_variables=["question"])
llm_chain = LLMChain(prompt=prompt, llm=generate_text)
question = "What is electroencephalography?"
print(llm_chain.run(question))

Running this code produces the following error:

1 validation error for LLMChain
llm
value is not a valid dict (type=type_error.dict)

I'm guessing LLMChain isn't compatible with transformers pipeline as this code works fine if "generate_text" is switched out with an OpenAI model. Installed packages into a venv via requirements.txt and pip install transformers accelerate torch. The original requirements.txt doesn't include transformers as far as I can tell. However, this is written in the book on page 86:

I haven’t included accelerate in the main requirements, but I’ve included the
transformers library. If you don’t have all libraries installed, make sure you execute
this command:
pip install transformers accelerate torch

error when running docker build on mac os (Apple silicon)

`Dockerfile:10

9 |
10 | >>> RUN wget
11 | >>> https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
12 | >>> && mkdir /root/.conda
13 | >>> && bash Miniconda3-latest-Linux-x86_64.sh -b
14 | >>> && rm -f Miniconda3-latest-Linux-x86_64.sh
15 |

ERROR: failed to solve: process "/bin/sh -c wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && mkdir /root/.conda && bash Miniconda3-latest-Linux-x86_64.sh -b && rm -f Miniconda3-latest-Linux-x86_64.sh" did not complete successfully: exit code: 133`

I am not able in create conda env using .yaml file. Here is the message - (base) admin_user@llm-vm:~$ conda env create --file langchain_ai.yaml --force Solving environment: failed ResolvePackageNotFound: -- I am using following Linux env - Description: Ubuntu 22.04.4 LTS Release: 22.04 Codename: jammy, anaconda version is 2023.09-0

Please note that the code on GitHub and the book refer to particular versions of LangChain. Because LC is changing so heavily, if you are using different versions the code will not work without modifications.

Describe the problem
A clear and concise description of what the problem is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to this directory 'cd .. '
  2. Run python ...
  3. See error

Expected behavior
A clear and concise description of what you expected to happen.

Error
Please add the full error/exception (with stack trace) if possible. If applicable, add screenshots to help explain your problem.

Software environment (please complete the following information):

  • OS: [e.g. Windows 10, Ubuntu 22.10, MacOS 13.6.6]
  • LangChain version [e.g. 0.1, 0.0.284]
  • Python version [e.g. 3.11.8]

Additional context
Add any other context about the problem here.

LLama.cpp model 3B is not available

Chapter 3 explains the method to download the LLama.cpp model weights and tokens. This chapter specified 3B model. I have two question:
1- The available model weights and tokens are for models 7B and up. I can't find 3B in the given choices. Should I download 7B then?
2- After the chapter explained the installation and download methodolgy, it didn't use the Llama.cpp model and went straight to talking about GPT4ALL. Will the LLama.cpp be needed to complete future examples in the book? If it's not needed I will not download it because of the large disk space it needs.

Discrepancy in File Name and Package Versions in Conda Environment File

The Conda environment file provided in the repository has a couple of issues:

File Naming: The documentation refers to the file as langchain_ai.yml, but the actual file in the repository is named langchain_ai.yaml. This discrepancy can lead to confusion.

Package Versioning: The specific versions and build IDs listed for each package in langchain_ai.yaml can lead to ResolvePackageNotFound errors during environment creation, especially if the user is on a different operating system or architecture.

Suggested Fixes:

Update the documentation to match the actual file name in the repository.

Consider removing specific versions and build IDs from the Conda environment file to make it more universally compatible. Alternatively, provide separate environment files for different operating systems or architectures.

pip install not working with Python 3.12

Hi Ben, I encountered a problem using pip install to install requirements with Python 3.12.

Using cached lanarky-0.7.16-py3-none-any.whl.metadata (6.7 kB)
ERROR: Ignored the following versions that require a different python version: 0.55.2 Requires-Python <3.5; 0.8.0 Requires-Python >=3.9,<3.12; 0.8.1 Requires-Python >=3.9,<3.12; 0.8.2 Requires-Python >=3.9,<3.12; 0.8.3 Requires-Python >=3.9,<3.12; 0.8.4 **Requires-Python >=3.9,<3.12**
ERROR: Could not find a version that satisfies the requirement ray[serve]>=2.6.3 (from versions: none)
ERROR: No matching distribution found for ray[serve]>=2.6.3

With Python 3.11, the installation of requirements works fine.

Issue with reading Resume

I am getting the following error:-

RuntimeError: no validator found for <class 'main.Resume'>, see arbitrary_types_allowed in Config

I tried to use the following code:-

"""Information information_extraction from documents.

The example CV is from https://github.com/xitanggg/open-resume.
"""
import os

Replace "<your_api_key>" with your actual key

os.environ["OPENAI_API_KEY"] = "<api_key>"

from typing import Optional

from langchain.chains import create_extraction_chain_pydantic
from langchain.chat_models import ChatOpenAI
from langchain.document_loaders import PyPDFLoader
from pydantic import BaseModel, Field

class Experience(BaseModel):
# the title doesn't seem to help at all.
start_date: Optional[str] = Field(description="When the job or study started.")
end_date: Optional[str] = Field(description="When the job or study ended.")
description: Optional[str] = Field(description="What the job or study entailed.")
country: Optional[str] = Field(description="The country of the institution.")

class Study(Experience):
degree: Optional[str] = Field(description="The degree obtained or expected.")
institution: Optional[str] = Field(
description="The university, college, or educational institution visited."
)
country: Optional[str] = Field(description="The country of the institution.")
grade: Optional[str] = Field(description="The grade achieved or expected.")

class WorkExperience(Experience):
company: str = Field(description="The company name of the work experience.")
job_title: Optional[str] = Field(description="The job title.")

class Resume(BaseModel):
first_name: Optional[str] = Field(description="The first name of the person.")
last_name: Optional[str] = Field(description="The last name of the person.")
linkedin_url: Optional[str] = Field(
description="The url of the linkedin profile of the person."
)
email_address: Optional[str] = Field(description="The email address of the person.")
nationality: Optional[str] = Field(description="The nationality of the person.")
skill: Optional[str] = Field(description="A skill listed or mentioned in a description.")
study: Optional[Study] = Field(
description="A study that the person completed or is in progress of completing."
)
work_experience: Optional[WorkExperience] = Field(
description="A work experience of the person."
)
hobby: Optional[str] = Field(description="A hobby or recreational activity of the person.")

def parse_cv(pdf_file_path: str) -> str:
"""Parse a resume.
Not totally sure about the return type: is it list[Resume]?
"""
pdf_loader = PyPDFLoader(pdf_file_path)
docs = pdf_loader.load_and_split()
# please note that function calling is not enabled for all models!
llm = ChatOpenAI(model_name="gpt-3.5-turbo")
chain = create_extraction_chain_pydantic(pydantic_schema=Resume, llm=llm)
return chain.run(docs)

if name == "main":
print(parse_cv(
pdf_file_path=r"C:\Users\bdevasish\Downloads\openresume-resume.pdf"
))

ResolvePackageNotFound of Readline and ncurses

I am using conda and wind10.

Retrieving notices: ...working... done
Collecting package metadata (repodata.json): done
Solving environment: failed

ResolvePackageNotFound:

  • readline=8.2
  • ncurses=6.4
    Then I tried to install readline and ncurses individually, then it said the following packages are not available from current channels.

conda install conda-forge::readline
conda install anaconda::ncurses

PackagesNotFoundError: The following packages are not available from current channels:

  • anaconda::ncurses

pip install have much lower version of above 2 libary.

Thanks for help.

No citation for summarize code in Chapter 4

Hey Ben,
Thanks for this amazing book, Checking to see if you can share citation for the code:

with get_openai_callback() as cb:
    response = llm_chain.predict(text=”Complete this text!”)
    print(f"Total Tokens: {cb.total_tokens}")
    print(f"Prompt Tokens: {cb.prompt_tokens}")
    print(f"Completion Tokens: {cb.completion_tokens}")
    print(f"Total Cost (USD): ${cb.total_cost}")
from langchain.chains import LLMCheckerChain
from langchain.llms import OpenAI
llm = OpenAI(temperature=0.7)
text = "What type of mammal lays the biggest eggs?"
checker_chain = LLMCheckerChain.from_llm(llm, verbose=True)
checker_chain.run(text)

AttributeError: module 'openai' has no attribute 'OpenAI'

I am getting an error for the following code in Chapter 4:-

from langchain import PromptTemplate, OpenAI
from langchain.schema import StrOutputParser
llm = OpenAI()
prompt = PromptTemplate.from_template(
"Summarize this text: {text}?"
)
runnable = prompt | llm | StrOutputParser()
summary = runnable.invoke({"text": text})

AttributeError: module 'openai' has no attribute 'OpenAI'

I have set the OpenAI API Key as:

import os

Replace "<your_api_key>" with your actual key

os.environ["OPENAI_API_KEY"] = ""

Replicate Example not working in Chapter 3

While running the following Replicate Example in LangChain:

Here is a simple example for creating an image:

from langchain.llms import Replicate

text2image = Replicate(
model="stability-ai/stable-diffusion:db21e45d3f7023abc2a46ee38a23973f6dce16bb082a930b0c49861f96d1e5bf",
input={"image_dimensions": "512x512"},)

image_url = text2image("a book cover for a book about creating generative ai applications in Python")

I get the following error:
Traceback (most recent call last):
File "C:\Users\Azus\Desktop\GenerativeAI_LangChain\examples\test.py", line 15, in <module>
image_url = text2image("a book cover for a book about creating generative ai applications in Python")
File "C:\Users\Azus\anaconda3\envs\langchain\lib\site-packages\langchain\llms\base.py", line 825, in __call__
self.generate(
File "C:\Users\Azus\anaconda3\envs\langchain\lib\site-packages\langchain\llms\base.py", line 621, in generate
output = self._generate_helper(
File "C:\Users\Azus\anaconda3\envs\langchain\lib\site-packages\langchain\llms\base.py", line 523, in _generate_helper
raise e
File "C:\Users\Azus\anaconda3\envs\langchain\lib\site-packages\langchain\llms\base.py", line 510, in _generate_helper
self._generate(
File "C:\Users\Azus\anaconda3\envs\langchain\lib\site-packages\langchain\llms\base.py", line 1000, in _generate
self._call(prompt, stop=stop, run_manager=run_manager, **kwargs)
File "C:\Users\Azus\anaconda3\envs\langchain\lib\site-packages\langchain\llms\replicate.py", line 115, in _call
version = model.versions.get(version_str)
File "C:\Users\Azus\anaconda3\envs\langchain\lib\site-packages\replicate\version.py", line 62, in get
resp = self._client._request(
File "C:\Users\Azus\anaconda3\envs\langchain\lib\site-packages\replicate\client.py", line 85, in _request
_raise_for_status(resp)
File "C:\Users\Azus\anaconda3\envs\langchain\lib\site-packages\replicate\client.py", line 358, in _raise_for_status
raise ReplicateError(resp.json()["detail"])
replicate.exceptions.ReplicateError: Not found.

information_extraction/__init__.py all ways want a validator on BaseModel classes

In information_extraction/__init__.py
There is always an error triggered because Resume class wants a validator. It doesn't matter if arbitrary_types_allowed=True is set or is with the original code.
Seems like an incompatibility issue.
Tried to fix with:

class Resume(BaseModel):
    class Config:
        arbitrary_types_allowed = False
    first_name: Optional[str] = Field(None, description="The first name of the person.")
    last_name: Optional[str] = Field(None, description="The last name of the person.")

But the error is always the same:

File "/workspaces/generative_ai_with_langchain/information_extraction/__init__.py", line 72, in <module>
    print(parse_cv(
          ^^^^^^^^^
  File "/workspaces/generative_ai_with_langchain/information_extraction/__init__.py", line 67, in parse_cv
    chain = create_extraction_chain_pydantic(pydantic_schema=Resume, llm=llm)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.12/site-packages/langchain/chains/openai_functions/extraction.py", line 101, in create_extraction_chain_pydantic
    class PydanticSchema(BaseModel):
  File "/opt/conda/lib/python3.12/site-packages/pydantic/v1/main.py", line 197, in __new__
    fields[ann_name] = ModelField.infer(
                       ^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.12/site-packages/pydantic/v1/fields.py", line 504, in infer
    return cls(
           ^^^^
  File "/opt/conda/lib/python3.12/site-packages/pydantic/v1/fields.py", line 434, in __init__
    self.prepare()
  File "/opt/conda/lib/python3.12/site-packages/pydantic/v1/fields.py", line 550, in prepare
    self._type_analysis()
  File "/opt/conda/lib/python3.12/site-packages/pydantic/v1/fields.py", line 756, in _type_analysis
    self.sub_fields = [self._create_sub_type(self.type_, '_' + self.name)]
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.12/site-packages/pydantic/v1/fields.py", line 806, in _create_sub_type
    return self.__class__(
           ^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.12/site-packages/pydantic/v1/fields.py", line 434, in __init__
    self.prepare()
  File "/opt/conda/lib/python3.12/site-packages/pydantic/v1/fields.py", line 555, in prepare
    self.populate_validators()
  File "/opt/conda/lib/python3.12/site-packages/pydantic/v1/fields.py", line 829, in populate_validators
    *(get_validators() if get_validators else list(find_validators(self.type_, self.model_config))),
                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.12/site-packages/pydantic/v1/validators.py", line 765, in find_validators
    raise RuntimeError(f'no validator found for {type_}, see `arbitrary_types_allowed` in Config')
RuntimeError: no validator found for <class '__main__.Resume'>, see `arbitrary_types_allowed` in Config

Conda env create Failed

Conda command to create new environment with dependencies failed. Please check below error. It seems to have failed downloading and installing ray (second last items in the langchain_ai.yaml file.

Relevant trace is provided below.

"Collecting ray[serve]>=2.6.3 (from -r /Users/harjitsinghsandhu/generative_ai_with_langchain/condaenv.2d2gaf81.requirements.txt (line 28))
Downloading ray-2.7.0-cp310-cp310-macosx_10_15_x86_64.whl (63.2 MB)
━━━━━━━━━━━━━━━━╸ 26.7/63.2 MB 292.6 kB/s eta 0:02:05

Pip subprocess error:
ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
ray[serve]>=2.6.3 from https://files.pythonhosted.org/packages/37/bc/02600626039ad6596ced511c52de9bab6a22811a607fe5783bee839a2c59/ray-2.7.0-cp310-cp310-macosx_10_15_x86_64.whl"

Add python dev tools to linux system requirements.

I was having issues installing requirements.txt on Ubuntu 22 and had to install python dev tools and build essentials to resolve.

sudo apt install python3-dev sudo apt-get install build-essential -y
For python dev tools, you might need to install the package specific to your python version.
sudo apt install python3.11-dev

chat_with_retrieval occur errors when use_flare = True or use_moderation =True

In chat_with_retrieval/app.py, an error occurs if use_flare = True and , error if use_moderation =True.

chat_with_documents.py:
FlareChain and ConversationalRetrievalChain have different input and output names.
For FlareChain, user_input and response are used.

if use_flare:
    params = {
        "user_input": user_query,
    }
else:
    params = {
        "question": user_query,
        "chat_history": MEMORY.chat_memory.messages,
    }
response = CONV_CHAIN.run(params, callbacks=[stream_handler])

utils.py:
In def init_memory(), output_key=response should be output_key=response for FlareChain.

return ConversationBufferMemory(
        memory_key='chat_history',
        return_messages=True,
        output_key='answer'
    )

Replace deprecated models

The following models have been deprecated on January 4th by OpenAI:

  • text-ada-001
  • text-babbage-001
  • text-curie-001
  • text-davinci-001
  • text-davinci-002
  • text-davinci-003
  • davinci-instruct-beta
  • curie-instruct-beta
  • code-search-ada-code-001
  • code-search-ada-text-001
  • code-search-babbage-code-001
  • code-search-babbage-text-001
  • text-search-ada-doc-001
  • text-search-ada-query-001
  • text-search-babbage-doc-001
  • text-search-babbage-query-001
  • text-search-curie-doc-001
  • text-search-curie-query-001
  • text-search-davinci-doc-001
  • text-search-davinci-query-001
  • text-similarity-ada-001
  • text-similarity-babbage-001
  • text-similarity-curie-001
  • text-similarity-davinci-001
  • text-davinci-edit-001
  • code-davinci-edit-001
  • text-davinci-insert-001
  • text-davinci-insert-002

If any of these models are mentioned in the code, they should be replaced by models that are still available.

When I build docker in my mac os, something errors happened

The version of my platform like this:

ProductName:		macOS
ProductVersion:		14.0
BuildVersion:		23A344

and when I execute the command docker build -t new_image ., some error looks like this:

[+] Building 13.2s (11/12)                                 docker:desktop-linux
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 881B                                       0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => [internal] load metadata for docker.io/library/ubuntu:20.04            2.9s
 => [1/8] FROM docker.io/library/ubuntu:20.04@sha256:f5c3e53367f142fab0b4  0.0s
 => [internal] load build context                                          0.0s
 => => transferring context: 474B                                          0.0s
 => CACHED [2/8] RUN apt-get update && apt-get install -y wget build-esse  0.0s
 => CACHED [3/8] RUN wget     https://repo.anaconda.com/miniconda/Minicon  0.0s
 => CACHED [4/8] RUN conda update -n base -c defaults conda -y && conda -  0.0s
 => CACHED [5/8] COPY langchain_ai.yaml .                                  0.0s
 => CACHED [6/8] COPY notebooks ./notebooks                                0.0s
 => ERROR [7/8] RUN conda env update --name base --file langchain_ai.yam  10.2s
------
 > [7/8] RUN conda env update --name base --file langchain_ai.yaml:
1.819
1.819 EnvironmentSectionNotValid: The following section on '/langchain_ai.yaml' is invalid and will be ignored:
1.819  - langchain_ai.yamlname
1.819
2.354 Channels:
2.354  - defaults
2.354 Platform: linux-64
2.354 Collecting package metadata (repodata.json): ...working... done
6.558 Solving environment: ...working... failed
7.203 Channels:
7.203  - defaults
7.203 Platform: linux-64
7.203 Collecting package metadata (repodata.json): ...working... done
9.797 Solving environment: ...working... failed
10.10
10.10 LibMambaUnsatisfiableError: Encountered problems while solving:
10.10   - package libmambapy-1.5.3-py311h2dafd23_0 requires openssl >=3.0.11,<4.0a0, but none of the providers can be installed
10.10
10.10 Could not solve for environment specs
10.10 The following packages are incompatible
10.10 β”œβ”€ conda 23.11.0  is installable and it requires
10.10 β”‚  └─ conda-libmamba-solver >=23.11.0 , which requires
10.10 β”‚     β”œβ”€ libmambapy >=1.5.3  with the potential options
10.10 β”‚     β”‚  β”œβ”€ libmambapy 1.5.3 would require
10.10 β”‚     β”‚  β”‚  └─ openssl >=3.0.11,<4.0a0 , which can be installed;
10.10 β”‚     β”‚  └─ libmambapy 1.5.3 would require
10.10 β”‚     β”‚     └─ openssl >=3.0.12,<4.0a0 , which can be installed;
10.10 β”‚     └─ python >=3.12,<3.13.0a0 , which requires
10.10 β”‚        └─ openssl >=3.0.11,<4.0a0 , which can be installed;
10.10 └─ openssl 3.0.9**  is not installable because it conflicts with any installable versions previously reported.
10.10
------
Dockerfile:21
--------------------
  19 |     COPY langchain_ai.yaml .
  20 |     COPY notebooks ./notebooks
  21 | >>> RUN conda env update --name base --file langchain_ai.yaml
  22 |
  23 |     WORKDIR /home
--------------------
ERROR: failed to solve: process "/bin/sh -c conda env update --name base --file langchain_ai.yaml" did not complete successfully: exit code: 1

Docker Setup Command

Books Errata:

Chapter 3 Setting up Docker:
Build the Docker image from the Dockerfile in this repository:
docker build -t langchain_ai

This should be

Build the Docker image from the Dockerfile in this repository:
docker build -t langchain_ai .

(Add .)

Hugging Face Transformers, code issue in Chapter 3

I am working on Windows 11. After executing the code:-

from transformers import pipeline
import torch

generate_text = pipeline(
model="aisquared/dlite-v1-355m",
torch_dtype=torch.bfloat16,
trust_remote_code=True,
device_map="auto",
framework="pt"
)
generate_text("In this chapter, we'll discuss first steps with generative AI in Python.")

I am getting the error:-

TypeError: transformers.generation.utils.GenerationMixin.generate() got multiple values for keyword argument 'pad_token_id'

Please help.

python_repl not found error

When trying the following code block in Python, throws the following error:

File "", line 1, in
File "/miniconda3/envs/langchain_ai/lib/python3.10/site-packages/langchain/agents/load_tools.py", line 614, in load_tools
raise ValueError(f"Got unknown tool {name}")
ValueError: Got unknown tool python_repl

chapter 3 - Using Hugging Face

Hi,
The following code snippet from Chapter 3 :
from langchain.llms import HuggingFaceHub
llm = HuggingFaceHub(
model_kwargs={"temperature": 0.5, "max_length": 64},
repo_id="google/flan-t5-xxl"
)
prompt = "In which country is Tokyo?"
completion = llm(prompt)
print(completion)

Is giving:


ValueError Traceback (most recent call last)
Cell In[6], line 2
1 prompt = "In which country is Tokyo?"
----> 2 completion = llm(prompt)
3 print(completion)

File D:\generative_ai_with_langchain\pyenv\Lib\site-packages\langchain\llms\base.py:825, in BaseLLM.call(self, prompt, stop, callbacks, tags, metadata, **kwargs)
818 if not isinstance(prompt, str):
819 raise ValueError(
820 "Argument prompt is expected to be a string. Instead found "
821 f"{type(prompt)}. If you want to run the LLM on multiple prompts, use "
822 "generate instead."
823 )
824 return (
--> 825 self.generate(
826 [prompt],
827 stop=stop,
828 callbacks=callbacks,
829 tags=tags,
830 metadata=metadata,
831 **kwargs,
832 )
833 .generations[0][0]
834 .text
835 )

File D:\generative_ai_with_langchain\pyenv\Lib\site-packages\langchain\llms\base.py:621, in BaseLLM.generate(self, prompts, stop, callbacks, tags, metadata, **kwargs)
612 raise ValueError(
613 "Asked to cache, but no cache found at langchain.cache."
614 )
615 run_managers = [
616 callback_manager.on_llm_start(
617 dumpd(self), [prompt], invocation_params=params, options=options
618 )[0]
619 for callback_manager, prompt in zip(callback_managers, prompts)
620 ]
--> 621 output = self._generate_helper(
622 prompts, stop, run_managers, bool(new_arg_supported), **kwargs
623 )
624 return output
625 if len(missing_prompts) > 0:

File D:\generative_ai_with_langchain\pyenv\Lib\site-packages\langchain\llms\base.py:523, in BaseLLM._generate_helper(self, prompts, stop, run_managers, new_arg_supported, **kwargs)
521 for run_manager in run_managers:
522 run_manager.on_llm_error(e)
--> 523 raise e
524 flattened_outputs = output.flatten()
525 for manager, flattened_output in zip(run_managers, flattened_outputs):

File D:\generative_ai_with_langchain\pyenv\Lib\site-packages\langchain\llms\base.py:510, in BaseLLM._generate_helper(self, prompts, stop, run_managers, new_arg_supported, **kwargs)
500 def _generate_helper(
501 self,
502 prompts: List[str],
(...)
506 **kwargs: Any,
507 ) -> LLMResult:
508 try:
509 output = (
--> 510 self._generate(
511 prompts,
512 stop=stop,
513 # TODO: support multiple run managers
514 run_manager=run_managers[0] if run_managers else None,
515 **kwargs,
516 )
517 if new_arg_supported
518 else self._generate(prompts, stop=stop)
519 )
520 except (KeyboardInterrupt, Exception) as e:
521 for run_manager in run_managers:

File D:\generative_ai_with_langchain\pyenv\Lib\site-packages\langchain\llms\base.py:1000, in LLM._generate(self, prompts, stop, run_manager, **kwargs)
997 new_arg_supported = inspect.signature(self._call).parameters.get("run_manager")
998 for prompt in prompts:
999 text = (
-> 1000 self._call(prompt, stop=stop, run_manager=run_manager, **kwargs)
1001 if new_arg_supported
1002 else self._call(prompt, stop=stop, **kwargs)
1003 )
1004 generations.append([Generation(text=text)])
1005 return LLMResult(generations=generations)

File D:\generative_ai_with_langchain\pyenv\Lib\site-packages\langchain\llms\huggingface_hub.py:112, in HuggingFaceHub._call(self, prompt, stop, run_manager, **kwargs)
110 response = self.client(inputs=prompt, params=params)
111 if "error" in response:
--> 112 raise ValueError(f"Error raised by inference API: {response['error']}")
113 if self.client.task == "text-generation":
114 # Text generation return includes the starter text.
115 text = response[0]["generated_text"][len(prompt) :]

ValueError: Error raised by inference API: Service Unavailable
Image1

No PythonREPLTool,no python_repl

1.from langchain_experimental.tools import PythonREPLTool
No tools,no PythonREPLTool
2.from langchain.agents import load_tools
in load_tools raise ValueError(f"Got unknown tool {name}")
ValueError: Got unknown tool python_repl

langchain[docarray] doesn't install

Used requirements.txt to install libs in a fresh docker container. Since I'm planning on using my GPU, I started with nvcr.io/nvidia/rapidsai/notebooks:23.12-cuda12.0-py3.10. All libraries in requirements.txt install with exception of langchain[docarray]. Here I get:
`Building wheels for collected packages: hnswlib
Building wheel for hnswlib (pyproject.toml) ... error
error: subprocess-exited-with-error

Γ— Building wheel for hnswlib (pyproject.toml) did not run successfully.
β”‚ exit code: 1
╰─> [55 lines of output]
running bdist_wheel
running build
running build_ext
creating tmp
gcc -pthread -B /opt/conda/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /opt/conda/include -fPIC -O2 -isystem /opt/conda/include -fPIC -I/opt/conda/include/python3.10 -c /tmp/tmp2lnz5r_o.cpp -o tmp/tmp2lnz5r_o.o -std=c++14
gcc -pthread -B /opt/conda/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /opt/conda/include -fPIC -O2 -isystem /opt/conda/include -fPIC -I/opt/conda/include/python3.10 -c /tmp/tmpql3olux4.cpp -o tmp/tmpql3olux4.o -std=c++11
Traceback (most recent call last):
File "/opt/conda/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in
main()
File "/opt/conda/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/opt/conda/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "/tmp/pip-build-env-k9nz_xdj/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 410, in build_wheel
return self._build_with_temp_dir(
File "/tmp/pip-build-env-k9nz_xdj/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 395, in _build_with_temp_dir
self.run_setup()
File "/tmp/pip-build-env-k9nz_xdj/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 311, in run_setup
exec(code, locals())
File "", line 131, in
File "/tmp/pip-build-env-k9nz_xdj/overlay/lib/python3.10/site-packages/setuptools/init.py", line 103, in setup
return distutils.core.setup(**attrs)
File "/tmp/pip-build-env-k9nz_xdj/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
File "/tmp/pip-build-env-k9nz_xdj/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/tmp/pip-build-env-k9nz_xdj/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/tmp/pip-build-env-k9nz_xdj/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 963, in run_command
super().run_command(command)
File "/tmp/pip-build-env-k9nz_xdj/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-k9nz_xdj/overlay/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 368, in run
self.run_command("build")
File "/tmp/pip-build-env-k9nz_xdj/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/tmp/pip-build-env-k9nz_xdj/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 963, in run_command
super().run_command(command)
File "/tmp/pip-build-env-k9nz_xdj/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-k9nz_xdj/overlay/lib/python3.10/site-packages/setuptools/_distutils/command/build.py", line 131, in run
self.run_command(cmd_name)
File "/tmp/pip-build-env-k9nz_xdj/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/tmp/pip-build-env-k9nz_xdj/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 963, in run_command
super().run_command(command)
File "/tmp/pip-build-env-k9nz_xdj/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-k9nz_xdj/overlay/lib/python3.10/site-packages/setuptools/command/build_ext.py", line 89, in run
_build_ext.run(self)
File "/tmp/pip-build-env-k9nz_xdj/overlay/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
self.build_extensions()
File "", line 101, in build_extensions
File "", line 70, in cpp_flag
RuntimeError: Unsupported compiler -- at least C++11 support is needed!
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for hnswlib
Failed to build hnswlib
ERROR: Could not build wheels for hnswlib, which is required to install pyproject.toml-based projects`
Looks like it's failing due to an unsupported C++ compiler. Will have a closer look.

can't build docker image

My setup is:
laptop: Apple M1 Pro
OS: Ventura 13.4.1 (c)
Docker engine: v20.10.24

when I run the docker build command I get the following:

docker build -t langchain_ai .
[+] Building 32.4s (11/12)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 74B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/continuumio/miniconda3:latest 0.8s
=> [1/8] FROM docker.io/continuumio/miniconda3:latest@sha256:5ee0ed861bce8f67acb0a3e8a416891781db54302d93bf20a3c6301d7683d7b9 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 844B 0.0s
=> CACHED [2/8] RUN apt-get update && apt-get install -y wget build-essential && rm -rf /var/lib/apt/lists/* 0.0s
=> CACHED [3/8] RUN conda update -n base -c defaults conda -y && conda --version 0.0s
=> CACHED [4/8] COPY langchain_ai.yaml . 0.0s
=> CACHED [5/8] COPY notebooks ./notebooks 0.0s
=> CACHED [6/8] RUN python -m pip install --upgrade pip && conda clean -a && python -m pip cache purge 0.0s
=> ERROR [7/8] RUN conda env update --name base --file langchain_ai.yaml -vv 31.4s

[7/8] RUN conda env update --name base --file langchain_ai.yaml -vv:
#11 0.397 INFO conda.conda_libmamba_solver.solver:_log_info(324): Using libmamba solver
#11 0.397 INFO conda.conda_libmamba_solver.solver:_log_info(325): Conda version: 24.1.0
#11 0.397 INFO conda.conda_libmamba_solver.solver:_log_info(326): Mamba version: 1.5.3
#11 0.397 INFO conda.conda_libmamba_solver.solver:_log_info(327): Target prefix: '/opt/conda'
#11 0.397 INFO conda.conda_libmamba_solver.solver:_log_info(328): Command: ['/opt/conda/bin/conda', 'env', 'update', '--name', 'base', '--file', 'langchain_ai.yaml', '-vv']
#11 0.397 INFO conda.conda_libmamba_solver.solver:_log_info(329): Specs to add: IndexedSet([MatchSpec("bzip2=1.0.8"), MatchSpec("ca-certificates"), MatchSpec("libffi=3.4.4"), MatchSpec("ncurses=6.4"), MatchSpec("openssl"), MatchSpec("pandoc=2.12"), MatchSpec("pip=23.1.2"), MatchSpec("python=3.10.12"), MatchSpec("readline=8.2"), MatchSpec("sqlite=3.41.2"), MatchSpec("tk=8.6.12"), MatchSpec("tzdata=2023c"), MatchSpec("xz=5.4.2"), MatchSpec("zlib=1.2.13")])
#11 0.397 INFO conda.conda_libmamba_solver.solver:_log_info(330): Specs to remove: frozenset()
#11 0.605 Channels:
#11 0.605 - defaults
#11 0.605 Platform: linux-aarch64
#11 0.605 Collecting package metadata (repodata.json): ...working... INFO conda.gateways.repodata.jlap.fetch:download_and_hash(262): Download 0 bytes {'User-Agent': 'conda/24.1.0 requests/2.31.0 CPython/3.11.5 Linux/5.15.49-linuxkit debian/11.8 glibc/2.31 solver/libmamba conda-libmamba-solver/23.11.1 libmambapy/1.5.3', 'Accept-Encoding': 'gzip, deflate, br', 'Accept': '/', 'Connection': 'keep-alive'}
#11 0.954 INFO conda.gateways.repodata.jlap.fetch:request_url_jlap_state(408): Apply 0 patches f7b312ec41b2498c… β†’ f7b312ec41b2498c…
#11 1.294 INFO conda.gateways.repodata.jlap.fetch:download_and_hash(262): Download 2372338 bytes {'User-Agent': 'conda/24.1.0 requests/2.31.0 CPython/3.11.5 Linux/5.15.49-linuxkit debian/11.8 glibc/2.31 solver/libmamba conda-libmamba-solver/23.11.1 libmambapy/1.5.3', 'Accept-Encoding': 'gzip, deflate, br', 'Accept': '/', 'Connection': 'keep-alive'}
#11 1.295 INFO conda.gateways.repodata.jlap.fetch:request_url_jlap_state(408): Apply 0 patches 27e5d510959fdde4… β†’ 27e5d510959fdde4…
#11 1.500 INFO conda.gateways.repodata.jlap.fetch:download_and_hash(262): Download 702836 bytes {'User-Agent': 'conda/24.1.0 requests/2.31.0 CPython/3.11.5 Linux/5.15.49-linuxkit debian/11.8 glibc/2.31 solver/libmamba conda-libmamba-solver/23.11.1 libmambapy/1.5.3', 'Accept-Encoding': 'gzip, deflate, br', 'Accept': '/', 'Connection': 'keep-alive'}
#11 1.501 INFO conda.gateways.repodata.jlap.fetch:request_url_jlap_state(408): Apply 0 patches fd8b79f5ace4c7c7… β†’ fd8b79f5ace4c7c7…
#11 2.334 INFO conda.gateways.repodata.jlap.fetch:download_and_hash(262): Download 2050706 bytes {'User-Agent': 'conda/24.1.0 requests/2.31.0 CPython/3.11.5 Linux/5.15.49-linuxkit debian/11.8 glibc/2.31 solver/libmamba conda-libmamba-solver/23.11.1 libmambapy/1.5.3', 'Accept-Encoding': 'gzip, deflate, br', 'Accept': '/', 'Connection': 'keep-alive'}
#11 2.334 INFO conda.gateways.repodata.jlap.fetch:request_url_jlap_state(408): Apply 0 patches c25462d7872987b0… β†’ c25462d7872987b0…
#11 2.893 done
#11 2.893 Solving environment: ...working... done
#11 2.997 INFO conda.core.link:init(210): initializing UnlinkLinkTransaction with
#11 2.997 target_prefix: /opt/conda
#11 2.997 unlink_precs:
#11 2.997 defaults/linux-aarch64::conda-libmamba-solver-23.11.1-py311hd43f75c_0
#11 2.997 defaults/linux-aarch64::conda-24.1.0-py311hd43f75c_0
#11 2.997 defaults/linux-aarch64::requests-2.31.0-py311hd43f75c_0
#11 2.997 defaults/linux-aarch64::urllib3-1.26.18-py311hd43f75c_0
#11 2.997 defaults/linux-aarch64::conda-package-handling-2.2.0-py311hd43f75c_0
#11 2.997 defaults/linux-aarch64::pyopenssl-23.2.0-py311hd43f75c_0
#11 2.997 defaults/linux-aarch64::conda-package-streaming-0.9.0-py311hd43f75c_0
#11 2.997 defaults/linux-aarch64::conda-content-trust-0.2.0-py311hd43f75c_0
#11 2.997 defaults/linux-aarch64::zstandard-0.19.0-py311h998d150_0
#11 2.997 defaults/linux-aarch64::cryptography-41.0.3-py311h5077475_0
#11 2.997 defaults/linux-aarch64::pip-23.3-py311hd43f75c_0
#11 2.997 defaults/noarch::jsonpatch-1.32-pyhd3eb1b0_0
#11 2.997 defaults/linux-aarch64::cffi-1.15.1-py311h998d150_3
#11 2.997 defaults/linux-aarch64::wheel-0.41.2-py311hd43f75c_0
#11 2.997 defaults/linux-aarch64::truststore-0.8.0-py311hd43f75c_0
#11 2.997 defaults/linux-aarch64::tqdm-4.65.0-py311h2163289_0
#11 2.997 defaults/linux-aarch64::setuptools-68.0.0-py311hd43f75c_0
#11 2.997 defaults/linux-aarch64::ruamel.yaml-0.17.21-py311h998d150_0
#11 2.997 defaults/linux-aarch64::pysocks-1.7.1-py311hd43f75c_0
#11 2.997 defaults/noarch::pycparser-2.21-pyhd3eb1b0_0
#11 2.997 defaults/linux-aarch64::pycosat-0.6.6-py311h998d150_0
#11 2.997 defaults/linux-aarch64::pluggy-1.0.0-py311hd43f75c_1
#11 2.997 defaults/linux-aarch64::platformdirs-3.10.0-py311hd43f75c_0
#11 2.997 defaults/linux-aarch64::packaging-23.1-py311hd43f75c_0
#11 2.997 defaults/linux-aarch64::libmambapy-1.5.3-py311hd82f176_0
#11 2.997 defaults/noarch::jsonpointer-2.1-pyhd3eb1b0_0
#11 2.997 defaults/linux-aarch64::idna-3.4-py311hd43f75c_0
#11 2.997 defaults/linux-aarch64::distro-1.8.0-py311hd43f75c_0
#11 2.997 defaults/noarch::charset-normalizer-2.0.4-pyhd3eb1b0_0
#11 2.997 defaults/linux-aarch64::certifi-2023.11.17-py311hd43f75c_0
#11 2.997 defaults/linux-aarch64::brotli-python-1.0.9-py311h419075a_7
#11 2.997 defaults/linux-aarch64::boltons-23.0.0-py311hd43f75c_0
#11 2.997 defaults/noarch::archspec-0.2.1-pyhd3eb1b0_0
#11 2.997 defaults/linux-aarch64::menuinst-2.0.2-py311hd43f75c_0
#11 2.997 defaults/linux-aarch64::libmamba-1.5.3-h78dbd8a_0
#11 2.997 defaults/linux-aarch64::python-3.11.5-h4bb2201_0
#11 2.997 link_precs:
#11 2.997 defaults/linux-aarch64::pandoc-2.12-hd43f75c_3
#11 2.997 defaults/linux-aarch64::python-3.10.12-h4bb2201_0
#11 2.997 defaults/linux-aarch64::libmamba-1.5.6-h78dbd8a_0
#11 2.997 defaults/linux-aarch64::menuinst-2.0.2-py310hd43f75c_0
#11 2.997 defaults/noarch::archspec-0.2.1-pyhd3eb1b0_0
#11 2.997 defaults/linux-aarch64::boltons-23.0.0-py310hd43f75c_0
#11 2.997 defaults/linux-aarch64::brotli-python-1.0.9-py310h419075a_7
#11 2.997 defaults/linux-aarch64::certifi-2023.11.17-py310hd43f75c_0
#11 2.997 defaults/noarch::charset-normalizer-2.0.4-pyhd3eb1b0_0
#11 2.997 defaults/linux-aarch64::distro-1.8.0-py310hd43f75c_0
#11 2.997 defaults/linux-aarch64::idna-3.4-py310hd43f75c_0
#11 2.997 defaults/noarch::jsonpointer-2.1-pyhd3eb1b0_0
#11 2.997 defaults/linux-aarch64::libmambapy-1.5.6-py310hd82f176_0
#11 2.997 defaults/linux-aarch64::packaging-23.1-py310hd43f75c_0
#11 2.997 defaults/linux-aarch64::platformdirs-3.10.0-py310hd43f75c_0
#11 2.997 defaults/linux-aarch64::pluggy-1.0.0-py310hd43f75c_1
#11 2.997 defaults/linux-aarch64::pycosat-0.6.6-py310h998d150_0
#11 2.997 defaults/noarch::pycparser-2.21-pyhd3eb1b0_0
#11 2.997 defaults/linux-aarch64::pysocks-1.7.1-py310hd43f75c_0
#11 2.997 defaults/linux-aarch64::ruamel.yaml.clib-0.2.6-py310h998d150_1
#11 2.997 defaults/linux-aarch64::setuptools-68.2.2-py310hd43f75c_0
#11 2.997 defaults/linux-aarch64::tqdm-4.65.0-py310ha5ee653_0
#11 2.997 defaults/linux-aarch64::truststore-0.8.0-py310hd43f75c_0
#11 2.997 defaults/linux-aarch64::wheel-0.41.2-py310hd43f75c_0
#11 2.997 defaults/linux-aarch64::cffi-1.16.0-py310h998d150_0
#11 2.997 defaults/noarch::jsonpatch-1.32-pyhd3eb1b0_0
#11 2.997 defaults/linux-aarch64::pip-23.1.2-py310hd43f75c_0
#11 2.997 defaults/linux-aarch64::ruamel.yaml-0.17.21-py310h998d150_0
#11 2.997 defaults/linux-aarch64::cryptography-41.0.7-py310h5077475_0
#11 2.997 defaults/linux-aarch64::zstandard-0.19.0-py310h998d150_0
#11 2.997 defaults/linux-aarch64::conda-content-trust-0.2.0-py310hd43f75c_0
#11 2.997 defaults/linux-aarch64::conda-package-streaming-0.9.0-py310hd43f75c_0
#11 2.997 defaults/linux-aarch64::pyopenssl-23.2.0-py310hd43f75c_0
#11 2.997 defaults/linux-aarch64::conda-package-handling-2.2.0-py310hd43f75c_0
#11 2.997 defaults/linux-aarch64::urllib3-1.26.18-py310hd43f75c_0
#11 2.997 defaults/linux-aarch64::requests-2.31.0-py310hd43f75c_0
#11 2.997 defaults/linux-aarch64::conda-24.1.0-py310hd43f75c_0
#11 2.997 defaults/noarch::conda-libmamba-solver-24.1.0-pyhd3eb1b0_0
#11 2.997
#11 9.188
#11 9.188 Downloading and Extracting Packages: ...working... done
#11 9.188 Preparing transaction: ...working... done
#11 9.299 Verifying transaction: ...working... done
#11 9.663 Executing transaction: ...working... INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::conda-libmamba-solver-23.11.1-py311hd43f75c_0 <===
#11 9.664 prefix=/opt/conda
#11 9.664
#11 9.684 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::conda-24.1.0-py311hd43f75c_0 <===
#11 9.684 prefix=/opt/conda
#11 9.684
#11 10.01 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::requests-2.31.0-py311hd43f75c_0 <===
#11 10.01 prefix=/opt/conda
#11 10.01
#11 10.04 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::urllib3-1.26.18-py311hd43f75c_0 <===
#11 10.04 prefix=/opt/conda
#11 10.04
#11 10.09 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::conda-package-handling-2.2.0-py311hd43f75c_0 <===
#11 10.09 prefix=/opt/conda
#11 10.09
#11 10.11 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::pyopenssl-23.2.0-py311hd43f75c_0 <===
#11 10.11 prefix=/opt/conda
#11 10.11
#11 10.13 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::conda-package-streaming-0.9.0-py311hd43f75c_0 <===
#11 10.13 prefix=/opt/conda
#11 10.13
#11 10.15 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::conda-content-trust-0.2.0-py311hd43f75c_0 <===
#11 10.15 prefix=/opt/conda
#11 10.15
#11 10.18 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::zstandard-0.19.0-py311h998d150_0 <===
#11 10.18 prefix=/opt/conda
#11 10.18
#11 10.19 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::cryptography-41.0.3-py311h5077475_0 <===
#11 10.19 prefix=/opt/conda
#11 10.19
#11 10.32 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::pip-23.3-py311hd43f75c_0 <===
#11 10.32 prefix=/opt/conda
#11 10.32
#11 11.00 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/noarch::jsonpatch-1.32-pyhd3eb1b0_0 <===
#11 11.00 prefix=/opt/conda
#11 11.00
#11 11.01 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::cffi-1.15.1-py311h998d150_3 <===
#11 11.01 prefix=/opt/conda
#11 11.01
#11 11.04 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::wheel-0.41.2-py311hd43f75c_0 <===
#11 11.04 prefix=/opt/conda
#11 11.04
#11 11.09 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::truststore-0.8.0-py311hd43f75c_0 <===
#11 11.09 prefix=/opt/conda
#11 11.09
#11 11.10 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::tqdm-4.65.0-py311h2163289_0 <===
#11 11.10 prefix=/opt/conda
#11 11.10
#11 11.16 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::setuptools-68.0.0-py311hd43f75c_0 <===
#11 11.16 prefix=/opt/conda
#11 11.16
#11 11.45 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::ruamel.yaml-0.17.21-py311h998d150_0 <===
#11 11.45 prefix=/opt/conda
#11 11.45
#11 11.49 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::pysocks-1.7.1-py311hd43f75c_0 <===
#11 11.49 prefix=/opt/conda
#11 11.49
#11 11.51 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/noarch::pycparser-2.21-pyhd3eb1b0_0 <===
#11 11.51 prefix=/opt/conda
#11 11.51
#11 11.54 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::pycosat-0.6.6-py311h998d150_0 <===
#11 11.54 prefix=/opt/conda
#11 11.54
#11 11.55 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::pluggy-1.0.0-py311hd43f75c_1 <===
#11 11.55 prefix=/opt/conda
#11 11.55
#11 11.56 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::platformdirs-3.10.0-py311hd43f75c_0 <===
#11 11.56 prefix=/opt/conda
#11 11.56
#11 11.58 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::packaging-23.1-py311hd43f75c_0 <===
#11 11.58 prefix=/opt/conda
#11 11.58
#11 11.60 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::libmambapy-1.5.3-py311hd82f176_0 <===
#11 11.60 prefix=/opt/conda
#11 11.60
#11 11.61 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/noarch::jsonpointer-2.1-pyhd3eb1b0_0 <===
#11 11.61 prefix=/opt/conda
#11 11.61
#11 11.62 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::idna-3.4-py311hd43f75c_0 <===
#11 11.62 prefix=/opt/conda
#11 11.62
#11 11.63 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::distro-1.8.0-py311hd43f75c_0 <===
#11 11.63 prefix=/opt/conda
#11 11.63
#11 11.64 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/noarch::charset-normalizer-2.0.4-pyhd3eb1b0_0 <===
#11 11.64 prefix=/opt/conda
#11 11.64
#11 11.66 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::certifi-2023.11.17-py311hd43f75c_0 <===
#11 11.66 prefix=/opt/conda
#11 11.66
#11 11.67 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::brotli-python-1.0.9-py311h419075a_7 <===
#11 11.67 prefix=/opt/conda
#11 11.67
#11 11.68 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::boltons-23.0.0-py311hd43f75c_0 <===
#11 11.68 prefix=/opt/conda
#11 11.68
#11 11.73 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/noarch::archspec-0.2.1-pyhd3eb1b0_0 <===
#11 11.73 prefix=/opt/conda
#11 11.73
#11 11.77 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::menuinst-2.0.2-py311hd43f75c_0 <===
#11 11.77 prefix=/opt/conda
#11 11.77
#11 11.81 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::libmamba-1.5.3-h78dbd8a_0 <===
#11 11.81 prefix=/opt/conda
#11 11.81
#11 11.89 INFO conda.core.link:_execute_actions(991): ===> UNLINKING PACKAGE: defaults/linux-aarch64::python-3.11.5-h4bb2201_0 <===
#11 11.89 prefix=/opt/conda
#11 11.89
#11 13.41 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::pandoc-2.12-hd43f75c_3 <===
#11 13.41 prefix=/opt/conda
#11 13.41 source=/opt/conda/pkgs/pandoc-2.12-hd43f75c_3
#11 13.41
#11 13.41 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::python-3.10.12-h4bb2201_0 <===
#11 13.41 prefix=/opt/conda
#11 13.41 source=/opt/conda/pkgs/python-3.10.12-h4bb2201_0
#11 13.41
#11 13.48 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::libmamba-1.5.6-h78dbd8a_0 <===
#11 13.48 prefix=/opt/conda
#11 13.48 source=/opt/conda/pkgs/libmamba-1.5.6-h78dbd8a_0
#11 13.48
#11 13.49 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::menuinst-2.0.2-py310hd43f75c_0 <===
#11 13.49 prefix=/opt/conda
#11 13.49 source=/opt/conda/pkgs/menuinst-2.0.2-py310hd43f75c_0
#11 13.49
#11 13.49 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::archspec-0.2.1-pyhd3eb1b0_0 <===
#11 13.49 prefix=/opt/conda
#11 13.49 source=/opt/conda/pkgs/archspec-0.2.1-pyhd3eb1b0_0
#11 13.49
#11 13.49 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::boltons-23.0.0-py310hd43f75c_0 <===
#11 13.49 prefix=/opt/conda
#11 13.49 source=/opt/conda/pkgs/boltons-23.0.0-py310hd43f75c_0
#11 13.49
#11 13.49 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::brotli-python-1.0.9-py310h419075a_7 <===
#11 13.49 prefix=/opt/conda
#11 13.49 source=/opt/conda/pkgs/brotli-python-1.0.9-py310h419075a_7
#11 13.49
#11 13.49 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::certifi-2023.11.17-py310hd43f75c_0 <===
#11 13.49 prefix=/opt/conda
#11 13.49 source=/opt/conda/pkgs/certifi-2023.11.17-py310hd43f75c_0
#11 13.49
#11 13.50 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::charset-normalizer-2.0.4-pyhd3eb1b0_0 <===
#11 13.50 prefix=/opt/conda
#11 13.50 source=/opt/conda/pkgs/charset-normalizer-2.0.4-pyhd3eb1b0_0
#11 13.50
#11 13.50 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::distro-1.8.0-py310hd43f75c_0 <===
#11 13.50 prefix=/opt/conda
#11 13.50 source=/opt/conda/pkgs/distro-1.8.0-py310hd43f75c_0
#11 13.50
#11 13.50 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::idna-3.4-py310hd43f75c_0 <===
#11 13.50 prefix=/opt/conda
#11 13.50 source=/opt/conda/pkgs/idna-3.4-py310hd43f75c_0
#11 13.50
#11 13.50 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::jsonpointer-2.1-pyhd3eb1b0_0 <===
#11 13.50 prefix=/opt/conda
#11 13.50 source=/opt/conda/pkgs/jsonpointer-2.1-pyhd3eb1b0_0
#11 13.50
#11 13.50 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::libmambapy-1.5.6-py310hd82f176_0 <===
#11 13.50 prefix=/opt/conda
#11 13.50 source=/opt/conda/pkgs/libmambapy-1.5.6-py310hd82f176_0
#11 13.50
#11 13.50 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::packaging-23.1-py310hd43f75c_0 <===
#11 13.50 prefix=/opt/conda
#11 13.50 source=/opt/conda/pkgs/packaging-23.1-py310hd43f75c_0
#11 13.50
#11 13.50 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::platformdirs-3.10.0-py310hd43f75c_0 <===
#11 13.50 prefix=/opt/conda
#11 13.50 source=/opt/conda/pkgs/platformdirs-3.10.0-py310hd43f75c_0
#11 13.50
#11 13.50 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::pluggy-1.0.0-py310hd43f75c_1 <===
#11 13.50 prefix=/opt/conda
#11 13.50 source=/opt/conda/pkgs/pluggy-1.0.0-py310hd43f75c_1
#11 13.50
#11 13.50 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::pycosat-0.6.6-py310h998d150_0 <===
#11 13.50 prefix=/opt/conda
#11 13.50 source=/opt/conda/pkgs/pycosat-0.6.6-py310h998d150_0
#11 13.50
#11 13.50 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::pycparser-2.21-pyhd3eb1b0_0 <===
#11 13.50 prefix=/opt/conda
#11 13.50 source=/opt/conda/pkgs/pycparser-2.21-pyhd3eb1b0_0
#11 13.50
#11 13.50 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::pysocks-1.7.1-py310hd43f75c_0 <===
#11 13.50 prefix=/opt/conda
#11 13.50 source=/opt/conda/pkgs/pysocks-1.7.1-py310hd43f75c_0
#11 13.50
#11 13.50 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::ruamel.yaml.clib-0.2.6-py310h998d150_1 <===
#11 13.50 prefix=/opt/conda
#11 13.50 source=/opt/conda/pkgs/ruamel.yaml.clib-0.2.6-py310h998d150_1
#11 13.50
#11 13.50 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::setuptools-68.2.2-py310hd43f75c_0 <===
#11 13.50 prefix=/opt/conda
#11 13.50 source=/opt/conda/pkgs/setuptools-68.2.2-py310hd43f75c_0
#11 13.50
#11 13.52 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::tqdm-4.65.0-py310ha5ee653_0 <===
#11 13.52 prefix=/opt/conda
#11 13.52 source=/opt/conda/pkgs/tqdm-4.65.0-py310ha5ee653_0
#11 13.52
#11 13.53 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::truststore-0.8.0-py310hd43f75c_0 <===
#11 13.53 prefix=/opt/conda
#11 13.53 source=/opt/conda/pkgs/truststore-0.8.0-py310hd43f75c_0
#11 13.53
#11 13.53 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::wheel-0.41.2-py310hd43f75c_0 <===
#11 13.53 prefix=/opt/conda
#11 13.53 source=/opt/conda/pkgs/wheel-0.41.2-py310hd43f75c_0
#11 13.53
#11 13.53 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::cffi-1.16.0-py310h998d150_0 <===
#11 13.53 prefix=/opt/conda
#11 13.53 source=/opt/conda/pkgs/cffi-1.16.0-py310h998d150_0
#11 13.53
#11 13.53 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::jsonpatch-1.32-pyhd3eb1b0_0 <===
#11 13.53 prefix=/opt/conda
#11 13.53 source=/opt/conda/pkgs/jsonpatch-1.32-pyhd3eb1b0_0
#11 13.53
#11 13.53 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::pip-23.1.2-py310hd43f75c_0 <===
#11 13.53 prefix=/opt/conda
#11 13.53 source=/opt/conda/pkgs/pip-23.1.2-py310hd43f75c_0
#11 13.53
#11 13.57 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::ruamel.yaml-0.17.21-py310h998d150_0 <===
#11 13.57 prefix=/opt/conda
#11 13.57 source=/opt/conda/pkgs/ruamel.yaml-0.17.21-py310h998d150_0
#11 13.57
#11 13.57 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::cryptography-41.0.7-py310h5077475_0 <===
#11 13.57 prefix=/opt/conda
#11 13.57 source=/opt/conda/pkgs/cryptography-41.0.7-py310h5077475_0
#11 13.57
#11 13.58 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::zstandard-0.19.0-py310h998d150_0 <===
#11 13.58 prefix=/opt/conda
#11 13.58 source=/opt/conda/pkgs/zstandard-0.19.0-py310h998d150_0
#11 13.58
#11 13.58 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::conda-content-trust-0.2.0-py310hd43f75c_0 <===
#11 13.58 prefix=/opt/conda
#11 13.58 source=/opt/conda/pkgs/conda-content-trust-0.2.0-py310hd43f75c_0
#11 13.58
#11 13.58 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::conda-package-streaming-0.9.0-py310hd43f75c_0 <===
#11 13.58 prefix=/opt/conda
#11 13.58 source=/opt/conda/pkgs/conda-package-streaming-0.9.0-py310hd43f75c_0
#11 13.58
#11 13.58 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::pyopenssl-23.2.0-py310hd43f75c_0 <===
#11 13.58 prefix=/opt/conda
#11 13.58 source=/opt/conda/pkgs/pyopenssl-23.2.0-py310hd43f75c_0
#11 13.58
#11 13.58 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::conda-package-handling-2.2.0-py310hd43f75c_0 <===
#11 13.58 prefix=/opt/conda
#11 13.58 source=/opt/conda/pkgs/conda-package-handling-2.2.0-py310hd43f75c_0
#11 13.58
#11 13.58 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::urllib3-1.26.18-py310hd43f75c_0 <===
#11 13.58 prefix=/opt/conda
#11 13.58 source=/opt/conda/pkgs/urllib3-1.26.18-py310hd43f75c_0
#11 13.58
#11 13.59 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::requests-2.31.0-py310hd43f75c_0 <===
#11 13.59 prefix=/opt/conda
#11 13.59 source=/opt/conda/pkgs/requests-2.31.0-py310hd43f75c_0
#11 13.59
#11 13.59 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::conda-24.1.0-py310hd43f75c_0 <===
#11 13.59 prefix=/opt/conda
#11 13.59 source=/opt/conda/pkgs/conda-24.1.0-py310hd43f75c_0
#11 13.59
#11 13.61 INFO conda.core.link:_execute_actions(998): ===> LINKING PACKAGE: defaults::conda-libmamba-solver-24.1.0-pyhd3eb1b0_0 <===
#11 13.61 prefix=/opt/conda
#11 13.61 source=/opt/conda/pkgs/conda-libmamba-solver-24.1.0-pyhd3eb1b0_0
#11 13.61
#11 14.10 done
#11 14.73 Installing pip dependencies: ...working... Pip subprocess error:
#11 31.03 ERROR: Ignored the following versions that require a different python version: 0.55.2 Requires-Python <3.5
#11 31.03 ERROR: Could not find a version that satisfies the requirement gpt4all>=1.0.6 (from versions: 0.1.5, 0.1.6, 0.1.7)
#11 31.03 ERROR: No matching distribution found for gpt4all>=1.0.6
#11 31.03 WARNING: There was an error checking the latest version of pip.
#11 31.03
#11 31.03 Ran pip subprocess with arguments:
#11 31.03 ['/opt/conda/bin/python', '-m', 'pip', 'install', '-U', '-r', '/condaenv.01sd0l8d.requirements.txt', '--exists-action=b']
#11 31.03 Pip subprocess output:
#11 31.03 Collecting setuptools==67.8.0 (from -r /condaenv.01sd0l8d.requirements.txt (line 1))
#11 31.03 Downloading setuptools-67.8.0-py3-none-any.whl (1.1 MB)
#11 31.03 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 3.0 MB/s eta 0:00:00
#11 31.03 Collecting wheel==0.38.4 (from -r /condaenv.01sd0l8d.requirements.txt (line 2))
#11 31.03 Downloading wheel-0.38.4-py3-none-any.whl (36 kB)
#11 31.03 Collecting jupyter>=1.0.0 (from -r /condaenv.01sd0l8d.requirements.txt (line 3))
#11 31.03 Downloading jupyter-1.0.0-py2.py3-none-any.whl (2.7 kB)
#11 31.03 Collecting jupyterlab (from -r /condaenv.01sd0l8d.requirements.txt (line 4))
#11 31.03 Downloading jupyterlab-4.0.12-py3-none-any.whl (9.2 MB)
#11 31.03 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.2/9.2 MB 7.1 MB/s eta 0:00:00
#11 31.03 Collecting langchain[docarray]==0.0.284 (from -r /condaenv.01sd0l8d.requirements.txt (line 5))
#11 31.03 Downloading langchain-0.0.284-py3-none-any.whl (1.7 MB)
#11 31.03 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.7/1.7 MB 5.4 MB/s eta 0:00:00
#11 31.03 Collecting langchain_experimental (from -r /condaenv.01sd0l8d.requirements.txt (line 6))
#11 31.03 Downloading langchain_experimental-0.0.50-py3-none-any.whl (166 kB)
#11 31.03 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 166.8/166.8 kB 6.7 MB/s eta 0:00:00
#11 31.03 Collecting langsmith>=0.0.65 (from -r /condaenv.01sd0l8d.requirements.txt (line 7))
#11 31.03 Downloading langsmith-0.0.86-py3-none-any.whl (54 kB)
#11 31.03 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 54.4/54.4 kB 4.6 MB/s eta 0:00:00
#11 31.03 Collecting huggingface_hub>=0.14.1 (from -r /condaenv.01sd0l8d.requirements.txt (line 8))
#11 31.03 Downloading huggingface_hub-0.20.3-py3-none-any.whl (330 kB)
#11 31.03 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 330.1/330.1 kB 5.4 MB/s eta 0:00:00
#11 31.03 Collecting openai==0.28.1 (from -r /condaenv.01sd0l8d.requirements.txt (line 9))
#11 31.03 Downloading openai-0.28.1-py3-none-any.whl (76 kB)
#11 31.03 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.0/77.0 kB 3.5 MB/s eta 0:00:00
#11 31.03 Collecting google-cloud-aiplatform>=1.26.0 (from -r /condaenv.01sd0l8d.requirements.txt (line 10))
#11 31.03 Downloading google_cloud_aiplatform-1.40.0-py2.py3-none-any.whl (3.4 MB)
#11 31.03 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.4/3.4 MB 6.7 MB/s eta 0:00:00
#11 31.03 Collecting replicate (from -r /condaenv.01sd0l8d.requirements.txt (line 11))
#11 31.03 Downloading replicate-0.23.1-py3-none-any.whl (36 kB)
#11 31.03 Collecting google-generativeai (from -r /condaenv.01sd0l8d.requirements.txt (line 12))
#11 31.03 Downloading google_generativeai-0.3.2-py3-none-any.whl (146 kB)
#11 31.03 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 146.9/146.9 kB 8.6 MB/s eta 0:00:00
#11 31.03 Collecting ruff==0.0.278 (from -r /condaenv.01sd0l8d.requirements.txt (line 13))
#11 31.03 Downloading ruff-0.0.278-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.3 MB)
#11 31.03 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.3/5.3 MB 5.9 MB/s eta 0:00:00
#11 31.03 Collecting pypdf>=3.12.2 (from -r /condaenv.01sd0l8d.requirements.txt (line 14))
#11 31.03 Downloading pypdf-4.0.1-py3-none-any.whl (283 kB)
#11 31.03 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 284.0/284.0 kB 4.6 MB/s eta 0:00:00
#11 31.03 Collecting tiktoken>=0.4.0 (from -r /condaenv.01sd0l8d.requirements.txt (line 15))
#11 31.03 Downloading tiktoken-0.5.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.0 MB)
#11 31.03 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 4.8 MB/s eta 0:00:00
#11 31.03 Collecting duckduckgo_search>=3.8.4 (from -r /condaenv.01sd0l8d.requirements.txt (line 16))
#11 31.03 Downloading duckduckgo_search-4.4-py3-none-any.whl (20 kB)
#11 31.03 Collecting streamlit>=1.24.1 (from -r /condaenv.01sd0l8d.requirements.txt (line 17))
#11 31.03 Downloading streamlit-1.31.0-py2.py3-none-any.whl (8.4 MB)
#11 31.03 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.4/8.4 MB 4.1 MB/s eta 0:00:00
#11 31.03 Collecting arxiv>=1.4.8 (from -r /condaenv.01sd0l8d.requirements.txt (line 18))
#11 31.03 Downloading arxiv-2.1.0-py3-none-any.whl (11 kB)
#11 31.03 Collecting wikipedia>=1.4.0 (from -r /condaenv.01sd0l8d.requirements.txt (line 19))
#11 31.03 Downloading wikipedia-1.4.0.tar.gz (27 kB)
#11 31.03 Preparing metadata (setup.py): started
#11 31.03 Preparing metadata (setup.py): finished with status 'done'
#11 31.03 Collecting wolframalpha>=5.0.0 (from -r /condaenv.01sd0l8d.requirements.txt (line 20))
#11 31.03 Downloading wolframalpha-5.0.0-py3-none-any.whl (7.5 kB)
#11 31.03 Collecting unstructured>=0.8.1 (from -r /condaenv.01sd0l8d.requirements.txt (line 21))
#11 31.03 Downloading unstructured-0.12.3-py3-none-any.whl (1.8 MB)
#11 31.03 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 5.4 MB/s eta 0:00:00
#11 31.03 Collecting sentence_transformers>=2.2.2 (from -r /condaenv.01sd0l8d.requirements.txt (line 22))
#11 31.03 Downloading sentence_transformers-2.3.1-py3-none-any.whl (132 kB)
#11 31.03 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 132.8/132.8 kB 4.4 MB/s eta 0:00:00
#11 31.03 Collecting gradio>=3.38.0 (from -r /condaenv.01sd0l8d.requirements.txt (line 23))
#11 31.03 Downloading gradio-4.16.0-py3-none-any.whl (16.7 MB)
#11 31.03 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16.7/16.7 MB 3.3 MB/s eta 0:00:00
#11 31.03
#11 31.03 failed
#11 31.03
#11 31.03 CondaEnvException: Pip failed
#11 31.03


executor failed running [/bin/sh -c conda env update --name base --file langchain_ai.yaml -vv]: exit code: 1

I tried commenting out the gpt4all install in the langchain_ai.yaml file but I am still getting errors:

stack_trace2.log

No module named 'config'

1)when running streamlit run chat_with_retrieval/app.py, getting error
ModuleNotFoundError: No module named 'config'

  1. could you please provide details how to run/test the programs?

Please add a license to this repo

First, thank you for writing this book and sharing these notebooks with us!

Could you please add an explicit LICENSE file to the repo so that it's clear
under what terms the content is provided, and under what terms user
contributions are licensed?

Per GitHub docs on licensing:

[...] without a license, the default copyright laws apply, meaning that you
retain all rights to your source code and no one may reproduce, distribute,
or create derivative works from your work. If you're creating an open source
project, we strongly encourage you to include an open source license.

Thanks!

Conda and docker setups both fail

Docker build gives this error:

docker build -t langchain_ai .
...
Collecting lanarky==0.7.16 (from -r requirements.txt (line 27))
  Downloading lanarky-0.7.16-py3-none-any.whl.metadata (6.7 kB)
ERROR: Ignored the following versions that require a different python version: 0.12.0 Requires-Python >=3.9.0,<3.12; 0.12.2 Requires-Python >=3.9.0,<3.12; 0.12.3 Requires-Python >=3.9.0,<3.12; 0.12.4 Requires-Python >=3.9.0,<3.12; 0.12.5 Requires-Python >=3.9.0,<3.12; 0.12.6 Requires-Python >=3.9.0,<3.12; 0.13.0 Requires-Python <3.12,>=3.9.0; 0.13.1 Requires-Python <3.12,>=3.9.0; 0.13.2 Requires-Python <3.12,>=3.9.0; 0.13.3 Requires-Python <3.12,>=3.9.0; 0.13.4 Requires-Python <3.12,>=3.9.0; 0.55.2 Requires-Python <3.5; 0.8.0 Requires-Python >=3.9,<3.12; 0.8.1 Requires-Python >=3.9,<3.12; 0.8.2 Requires-Python >=3.9,<3.12; 0.8.3 Requires-Python >=3.9,<3.12; 0.8.4 Requires-Python >=3.9,<3.12; 0.8.5 Requires-Python >=3.9,<3.12; 0.8.6 Requires-Python <3.12,>=3.9
ERROR: Could not find a version that satisfies the requirement ray>=2.6.3 (from versions: none)
ERROR: No matching distribution found for ray>=2.6.3
The command '/bin/sh -c pip install --prefer-binary --no-cache-dir -r requirements.txt' returned a non-zero code: 1

Conda setup hangs when installing pip dependencies:

(base) $ conda env create --file langchain_ai.yaml 
Channels:
 - defaults
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: done

Downloading and Extracting Packages:
                                                                                                                                   
Preparing transaction: done                                                                                                        
Verifying transaction: done                                                                                                        
Executing transaction: done                                                                                                        
Installing pip dependencies:  (wait cursor spins)

LangChain: 1 validation error for LLMChain - value is not a valid dict (type=type_error.dict)

Hello, I'm truly enjoying this book. Thank you for such a well written book!
I was executing the code in chapter 3, page 86 (local models) but I get this error: LangChain: 1 validation error for LLMChain - value is not a valid dict (type=type_error.dict).
It's related to the following line:
llm_chain = LLMChain(prompt=prompt, llm=generate_text) . I found a a related post here. This post explians that the error was caused by a mistake in the import. Do you think it's the same problem in this situtation? here's what I executed!

from transformers import pipeline
import torch

generate_text= pipeline(
    model= "aisquared/dlite-v1-355m",
    torch_dtype=torch.bfloat16,
    trust_remote_code=True,
    device_map="auto",
    framework="pt",
)

Then this:

from langchain import PromptTemplate, LLMChain

template ="""Question: {question}
Answer: Let's think step by step"""
prompt = PromptTemplate(template=template, input_variables = ["question"])
llm_chain = LLMChain(prompt=prompt, llm=generate_text)
question ="what is electroencephalography?"
print(llm_chain.run(question))

Dockerfile failed to build

I followed instructions from the book as well as this repo's README.md. However, the Dockerfile seems not work.

Two issues I have encountered:

  1. Dockerfile references to langchain_ai.yml whereas the actual file is langchain_ai.yaml.
  2. After fixing the above issue, I still got the following errors from docker build -t langchain_ai .:
[+] Building 3.1s (10/11)                                                                                                                                docker:desktop-linux
 => [internal] load .dockerignore                                                                                                                                        0.0s
 => => transferring context: 2B                                                                                                                                          0.0s
 => [internal] load build definition from Dockerfile                                                                                                                     0.0s
 => => transferring dockerfile: 451B                                                                                                                                     0.0s
 => [internal] load metadata for docker.io/continuumio/miniconda3:latest                                                                                                 0.7s
 => [auth] continuumio/miniconda3:pull token for registry-1.docker.io                                                                                                    0.0s
 => [1/6] FROM docker.io/continuumio/miniconda3@sha256:db9f536d96d49fe21b5f4ac3252781bb0d2a3b58dab2d8e44343b85014366f00                                                  0.0s
 => [internal] load build context                                                                                                                                        0.0s
 => => transferring context: 473B                                                                                                                                        0.0s
 => CACHED [2/6] RUN conda update -n base -c defaults conda                                                                                                              0.0s
 => CACHED [3/6] COPY langchain_ai.yml .                                                                                                                                 0.0s
 => CACHED [4/6] COPY notebooks ./notebooks                                                                                                                              0.0s
 => ERROR [5/6] RUN conda env create -f langchain_ai.yml                                                                                                                 2.3s
------
 > [5/6] RUN conda env create -f langchain_ai.yml:
0.365 Collecting package metadata (repodata.json): ...working... done
2.124 Solving environment: ...working... failed
2.125
2.125 ResolvePackageNotFound:
2.125   - sqlite==3.41.2=h6c40b1e_0
2.125   - tk==8.6.12=h5d9f67b_0
2.125   - xz==5.4.2=h6c40b1e_0
2.125   - openssl==3.0.9=hca72f7f_0
2.125   - zlib==1.2.13=h4dc903c_0
2.125   - bzip2==1.0.8=h1de35cc_0
2.125   - libffi==3.4.4=hecd8cb5_0
2.125   - readline==8.2=hca72f7f_0
2.125   - python==3.10.12=h5ee71fb_0
2.125   - ca-certificates==2023.05.30=hecd8cb5_0
2.125   - ncurses==6.4=hcec6c5f_0
2.125
------
Dockerfile:8
--------------------
   6 |     COPY langchain_ai.yml .
   7 |     COPY notebooks ./notebooks
   8 | >>> RUN conda env create -f langchain_ai.yml
   9 |     WORKDIR /home
  10 |     EXPOSE 8080
--------------------
ERROR: failed to solve: process "/bin/sh -c conda env create -f langchain_ai.yml" did not complete successfully: exit code: 1```

ResolvePackageNotFound

Im using conda , when trying to create the enviroment got these message:

Collecting package metadata (repodata.json): done
Solving environment: failed

ResolvePackageNotFound:

  • readline=8.2
  • ncurses=6.4

Im on a windows 64 and these are the conda and python versions

D:\langchainbook>conda -V
conda 23.7.4

D:\langchainbook>python -V
Python 3.11.5

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.