Spaces:
Runtime error
Runtime error
Update models/llamaCustom.py
Browse files4 unmodified lines567891065 unmodified lines767778798081821 unmodified line848586878889909192934 unmodified linesimport numpy as npimport openaiimport pandas as pdfrom dotenv import load_dotenvfrom huggingface_hub import HfFileSystem65 unmodified linesdef _llm_type(self) -> str:return "custom"class LlamaCustom:# define llmllm_predictor = LLMPredictor(llm=CustomLLM())1 unmodified linellm_predictor=llm_predictor, prompt_helper=prompt_helper)def __init__(self, name: str) -> None:self.vector_index = self.initialize_index(index_name=name)def initialize_index(self, index_name):file_path = f"./vectorStores/{index_name}"if os.path.exists(path=file_path):# rebuild storage context4 unmodified lines56789101165 unmodified lines777879808182831 unmodified line8586878889909192939495964 unmodified linesimport numpy as npimport openaiimport streamlit as stimport pandas as pdfrom dotenv import load_dotenvfrom huggingface_hub import HfFileSystem65 unmodified linesdef _llm_type(self) -> str:return "custom"@st.cache_resourceclass LlamaCustom:# define llmllm_predictor = LLMPredictor(llm=CustomLLM())1 unmodified linellm_predictor=llm_predictor, prompt_helper=prompt_helper)def __init__(self, model_name: str) -> None:self.vector_index = self.initialize_index(index_name=model_name)def initialize_index(self, model_name: str):index_name = model_name.split("/")[-1]file_path = f"./vectorStores/{index_name}"if os.path.exists(path=file_path):# rebuild storage context
models/llamaCustom.py+7-4