Spaces:
Sleeping
Sleeping
Léo Bourrel
commited on
Commit
·
244cbec
1
Parent(s):
7932f4a
clean: isort
Browse files- custom_pgvector.py +2 -7
custom_pgvector.py
CHANGED
|
@@ -1,25 +1,20 @@
|
|
| 1 |
from __future__ import annotations
|
| 2 |
|
| 3 |
-
import asyncio
|
| 4 |
import contextlib
|
| 5 |
import enum
|
| 6 |
import json
|
| 7 |
import logging
|
| 8 |
-
from
|
| 9 |
-
from typing import (Any, Callable, Dict, Generator, Iterable, List, Optional,
|
| 10 |
-
Tuple, Type)
|
| 11 |
|
| 12 |
-
import numpy as np
|
| 13 |
import pandas as pd
|
| 14 |
import sqlalchemy
|
| 15 |
from langchain.docstore.document import Document
|
| 16 |
from langchain.schema.embeddings import Embeddings
|
| 17 |
from langchain.utils import get_from_dict_or_env
|
| 18 |
from langchain.vectorstores.base import VectorStore
|
| 19 |
-
from langchain.vectorstores.pgvector import BaseModel
|
| 20 |
from pgvector.sqlalchemy import Vector
|
| 21 |
from sqlalchemy import delete, text
|
| 22 |
-
from sqlalchemy.orm import Session, declarative_base
|
| 23 |
|
| 24 |
|
| 25 |
class DistanceStrategy(str, enum.Enum):
|
|
|
|
| 1 |
from __future__ import annotations
|
| 2 |
|
|
|
|
| 3 |
import contextlib
|
| 4 |
import enum
|
| 5 |
import json
|
| 6 |
import logging
|
| 7 |
+
from typing import Any, Dict, Generator, Iterable, List, Optional, Tuple, Type
|
|
|
|
|
|
|
| 8 |
|
|
|
|
| 9 |
import pandas as pd
|
| 10 |
import sqlalchemy
|
| 11 |
from langchain.docstore.document import Document
|
| 12 |
from langchain.schema.embeddings import Embeddings
|
| 13 |
from langchain.utils import get_from_dict_or_env
|
| 14 |
from langchain.vectorstores.base import VectorStore
|
|
|
|
| 15 |
from pgvector.sqlalchemy import Vector
|
| 16 |
from sqlalchemy import delete, text
|
| 17 |
+
from sqlalchemy.orm import Session, declarative_base
|
| 18 |
|
| 19 |
|
| 20 |
class DistanceStrategy(str, enum.Enum):
|