mem0 icon indicating copy to clipboard operation
mem0 copied to clipboard

TypeError afer running

Open alloevil opened this issue 2 years ago • 0 comments

i got the TypeError after running my code:

` import os os.environ["OPENAI_API_KEY"] = "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" from embedchain import App

naval_chat_bot = App()

naval_chat_bot.add("youtube_video", "https://www.youtube.com/watch?v=3qHkcs3kG44") naval_chat_bot.add("pdf_file", "https://navalmanack.s3.amazonaws.com/Eric-Jorgenson_The-Almanack-of-Naval-Ravikant_Final.pdf") naval_chat_bot.add("web_page", "https://nav.al/feedback") naval_chat_bot.add("web_page", "https://nav.al/agi")

naval_chat_bot.add_local("qna_pair", ("Who is Naval Ravikant?", "Naval Ravikant is an Indian-American entrepreneur and investor."))

naval_chat_bot.query("What unique capacity does Naval argue humans possess when it comes to understanding explanations or concepts?") ` exact the same as demo

the error:

` TypeError Traceback (most recent call last) Input In [15], in <cell line: 3>() 1 import os 2 os.environ["OPENAI_API_KEY"] = "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" ----> 3 from embedchain import App 5 naval_chat_bot = App() 7 # Embed Online Resources

File ~/anaconda3/lib/python3.9/site-packages/embedchain/init.py:1, in ----> 1 from .embedchain import App

File ~/anaconda3/lib/python3.9/site-packages/embedchain/embedchain.py:16, in 14 from embedchain.chunkers.web_page import WebPageChunker 15 from embedchain.chunkers.qna_pair import QnaPairChunker ---> 16 from embedchain.vectordb.chroma_db import ChromaDB 18 load_dotenv() 20 embeddings = OpenAIEmbeddings()

File ~/anaconda3/lib/python3.9/site-packages/embedchain/vectordb/chroma_db.py:1, in ----> 1 import chromadb 2 import os 4 from chromadb.utils import embedding_functions

File ~/anaconda3/lib/python3.9/site-packages/chromadb/init.py:6, in 4 from chromadb.telemetry import Telemetry 5 from chromadb.config import Settings, System ----> 6 from chromadb.api import API 8 logger = logging.getLogger(name) 10 __settings = Settings()

File ~/anaconda3/lib/python3.9/site-packages/chromadb/api/init.py:5, in 3 import pandas as pd 4 from uuid import UUID ----> 5 from chromadb.api.models.Collection import Collection 6 from chromadb.api.types import ( 7 CollectionMetadata, 8 Documents, (...) 17 WhereDocument, 18 ) 19 from chromadb.config import Component

File ~/anaconda3/lib/python3.9/site-packages/chromadb/api/models/Collection.py:4, in 2 from pydantic import BaseModel, PrivateAttr 3 from uuid import UUID ----> 4 import chromadb.utils.embedding_functions as ef 6 from chromadb.api.types import ( 7 CollectionMetadata, 8 Embedding, (...) 27 validate_embeddings, 28 ) 29 import logging

File ~/anaconda3/lib/python3.9/site-packages/chromadb/utils/embedding_functions.py:8, in 6 from typing import Any, Dict, List, cast 7 import numpy as np ----> 8 import numpy.typing as npt 9 import importlib 10 from typing import Optional

File ~/anaconda3/lib/python3.9/site-packages/numpy/typing/init.py:158, in 1 """ 2 ============================ 3 Typing (:mod:numpy.typing) (...) 153 154 """ 155 # NOTE: The API section will be appended with additional entries 156 # further down in this file --> 158 from numpy._typing import ( 159 ArrayLike, 160 DTypeLike, 161 NBitBase, 162 NDArray, 163 ) 165 all = ["ArrayLike", "DTypeLike", "NBitBase", "NDArray"] 167 if doc is not None:

File ~/anaconda3/lib/python3.9/site-packages/numpy/_typing/init.py:148, in 95 from ._nbit import ( 96 _NBitByte as _NBitByte, 97 _NBitShort as _NBitShort, (...) 105 _NBitLongDouble as _NBitLongDouble, 106 ) 107 from ._char_codes import ( 108 _BoolCodes as _BoolCodes, 109 _UInt8Codes as _UInt8Codes, (...) 146 _ObjectCodes as _ObjectCodes, 147 ) --> 148 from ._scalars import ( 149 _CharLike_co as _CharLike_co, 150 _BoolLike_co as _BoolLike_co, 151 _UIntLike_co as _UIntLike_co, 152 _IntLike_co as _IntLike_co, 153 _FloatLike_co as _FloatLike_co, 154 _ComplexLike_co as _ComplexLike_co, 155 _TD64Like_co as _TD64Like_co, 156 _NumberLike_co as _NumberLike_co, 157 _ScalarLike_co as _ScalarLike_co, 158 _VoidLike_co as _VoidLike_co, 159 ) 160 from ._shape import ( 161 _Shape as _Shape, 162 _ShapeLike as _ShapeLike, 163 ) 164 from ._dtype_like import ( 165 DTypeLike as DTypeLike, 166 _DTypeLike as _DTypeLike, (...) 180 _DTypeLikeComplex_co as _DTypeLikeComplex_co, 181 )

File ~/anaconda3/lib/python3.9/site-packages/numpy/_typing/_scalars.py:13, in 10 # The 6 <X>Like_co type-aliases below represent all scalars that can be 11 # coerced into <X> (with the casting rule same_kind) 12 BoolLike_co = Union[bool, np.bool] ---> 13 _UIntLike_co = Union[_BoolLike_co, np.unsignedinteger[Any]] 14 _IntLike_co = Union[_BoolLike_co, int, np.integer[Any]] 15 _FloatLike_co = Union[_IntLike_co, float, np.floating[Any]]

TypeError: 'type' object is not subscriptable ` mybe it's because the numpy version?

alloevil avatar Jun 25 '23 13:06 alloevil