Upload folder using huggingface_hub
Browse files2 unmodified lines34567898 unmodified lines181920212223242526276 unmodified lines3435363738392 unmodified linesimport jsonimport faissimport numpy as npfrom sentence_transformers import SentenceTransformerINDEX_PATH = "data/docs/docs.index"META_PATH = "data/docs/docs_meta.json"8 unmodified lines"file_not_found": "Jenkins pipeline workspace file not found","git_authentication_error": "Jenkins git authentication failed checkout"}model = SentenceTransformer("all-MiniLM-L6-v2",cache_folder="./models")def retrieve_docs(error_category: str):6 unmodified lines"Jenkins pipeline error")query_embedding = model.encode([query])distances, indices = index.search(query_embedding, TOP_K)2 unmodified lines3456788 unmodified lines171819202122232425262728293031326 unmodified lines394041424344452 unmodified linesimport jsonimport faissimport numpy as npINDEX_PATH = "data/docs/docs.index"META_PATH = "data/docs/docs_meta.json"8 unmodified lines"file_not_found": "Jenkins pipeline workspace file not found","git_authentication_error": "Jenkins git authentication failed checkout"}# Lazy load model_model = Nonedef get_model():global _modelif _model is None:from sentence_transformers import SentenceTransformer_model = SentenceTransformer("all-MiniLM-L6-v2", cache_folder="./models")return _modeldef retrieve_docs(error_category: str):6 unmodified lines"Jenkins pipeline error")model = get_model()query_embedding = model.encode([query])distances, indices = index.search(query_embedding, TOP_K)
retrieve_docs.py+11-5