Skip to content

Commit

Permalink
feat: fix typos, syntax errors and bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
ishaansehgal99 committed Sep 27, 2024
1 parent 33669fc commit 7165ccf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion presets/rag_service/embedding/huggingface_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class RemoteHuggingFaceEmbedding(BaseEmbeddingModel):
def __init__(self, model_name: str, api_key: str):
self.model = HuggingFaceInferenceAPIEmbedding(model_name=model_name, api_key=api_key)
self.model = HuggingFaceInferenceAPIEmbedding(model_name=model_name, token=api_key)

def get_text_embedding(self, text: str):
"""Returns the text embedding for a given input string."""
Expand Down
6 changes: 3 additions & 3 deletions presets/rag_service/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Dict, List

from crud.operations import RAGOperations
from embedding import get_embedding_model
from embedding.huggingface_local import LocalHuggingFaceEmbedding
from fastapi import FastAPI, HTTPException
from models import (DocumentResponse, IndexRequest, ListDocumentsResponse,
QueryRequest, RefreshRequest, UpdateRequest)
Expand All @@ -12,10 +12,10 @@
app = FastAPI()

# Initialize embedding model
embed_model = get_embedding_model(EMBEDDING_TYPE, MODEL_ID, ACCESS_SECRET)
embed_model = LocalHuggingFaceEmbedding(MODEL_ID)

# Initialize vector store
vector_store = FaissVectorStoreManager(dimension=384, embed_model=embed_model)
vector_store = FaissVectorStoreManager(embed_model=embed_model)

# Initialize RAG operations
rag_ops = RAGOperations(vector_store)
Expand Down

0 comments on commit 7165ccf

Please sign in to comment.