Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
homanp committed Feb 15, 2024
1 parent 22cacbf commit f101e3d
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 16 deletions.
3 changes: 1 addition & 2 deletions api/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ async def ingest(payload: RequestPayload) -> Dict:
summary_documents = await embedding_service.generate_summary_documents(
documents=chunks
)
print(summary_documents)
return {"success": True}

await asyncio.gather(
embedding_service.generate_and_upsert_embeddings(
documents=chunks, encoder=encoder, index_name=payload.index_name
Expand Down
2 changes: 1 addition & 1 deletion models/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from pydantic import BaseModel

from models.ingest import EncoderEnum, Encoder
from models.ingest import Encoder
from models.vector_database import VectorDatabase


Expand Down
15 changes: 7 additions & 8 deletions service/embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,20 @@

import numpy as np
import requests
from tqdm import tqdm
from unstructured.chunking.title import chunk_by_title
from unstructured.documents.elements import Element
from unstructured.partition.auto import partition


from semantic_router.encoders import (
BaseEncoder,
CohereEncoder,
OpenAIEncoder,
HuggingFaceEncoder,
OpenAIEncoder,
)
from tqdm import tqdm
from unstructured.chunking.title import chunk_by_title
from unstructured.documents.elements import Element
from unstructured.partition.auto import partition

from models.document import BaseDocument, BaseDocumentChunk
from models.file import File
from models.ingest import EncoderEnum, Encoder
from models.ingest import Encoder, EncoderEnum
from utils.logger import logger
from utils.summarise import completion
from vectordbs import get_vector_service
Expand Down
1 change: 1 addition & 0 deletions vectordbs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from dotenv import load_dotenv
from semantic_router.encoders import BaseEncoder
from semantic_router.encoders.openai import OpenAIEncoder

from models.vector_database import VectorDatabase
from vectordbs.astra import AstraService
from vectordbs.base import BaseVectorDatabase
Expand Down
2 changes: 1 addition & 1 deletion vectordbs/astra.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from typing import List

from astrapy.db import AstraDB
from semantic_router.encoders import BaseEncoder
from tqdm import tqdm

from semantic_router.encoders import BaseEncoder
from models.document import BaseDocumentChunk
from vectordbs.base import BaseVectorDatabase

Expand Down
2 changes: 1 addition & 1 deletion vectordbs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from typing import List

from decouple import config
from semantic_router.encoders import BaseEncoder
from tqdm import tqdm

from semantic_router.encoders import BaseEncoder
from models.delete import DeleteResponse
from models.document import BaseDocumentChunk
from utils.logger import logger
Expand Down
2 changes: 1 addition & 1 deletion vectordbs/pinecone.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from typing import List

from pinecone import Pinecone, ServerlessSpec
from semantic_router.encoders import BaseEncoder
from tqdm import tqdm

from semantic_router.encoders import BaseEncoder
from models.delete import DeleteResponse
from models.document import BaseDocumentChunk
from utils.logger import logger
Expand Down
2 changes: 1 addition & 1 deletion vectordbs/qdrant.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

from qdrant_client import QdrantClient
from qdrant_client.http import models as rest
from semantic_router.encoders import BaseEncoder
from tqdm import tqdm

from semantic_router.encoders import BaseEncoder
from models.document import BaseDocumentChunk
from vectordbs.base import BaseVectorDatabase

Expand Down
2 changes: 1 addition & 1 deletion vectordbs/weaviate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from typing import List

import weaviate
from semantic_router.encoders import BaseEncoder
from tqdm import tqdm

from semantic_router.encoders import BaseEncoder
from models.delete import DeleteResponse
from models.document import BaseDocumentChunk
from utils.logger import logger
Expand Down

0 comments on commit f101e3d

Please sign in to comment.