Spaces:
Sleeping
Sleeping
Update models/llamaCustom.py
Browse files- models/llamaCustom.py +2 -2
models/llamaCustom.py
CHANGED
|
@@ -87,7 +87,7 @@ class LlamaCustom:
|
|
| 87 |
def __init__(self, name: str) -> None:
|
| 88 |
self.vector_index = self.initialize_index(index_name=name)
|
| 89 |
|
| 90 |
-
def prepare_data(file_path: str):
|
| 91 |
df = pd.read_json(file_path)
|
| 92 |
df = df.replace(to_replace="", value=np.nan).dropna(axis=0) # remove null values
|
| 93 |
|
|
@@ -122,7 +122,7 @@ class LlamaCustom:
|
|
| 122 |
# index = pickle.loads(file.readlines())
|
| 123 |
return index
|
| 124 |
else:
|
| 125 |
-
documents = prepare_data(r"./assets/regItems.json")
|
| 126 |
#documents = SimpleDirectoryReader(input_dir="./assets/pdf").load_data()
|
| 127 |
|
| 128 |
index = GPTVectorStoreIndex.from_documents(
|
|
|
|
| 87 |
def __init__(self, name: str) -> None:
|
| 88 |
self.vector_index = self.initialize_index(index_name=name)
|
| 89 |
|
| 90 |
+
def prepare_data(self, file_path: str):
|
| 91 |
df = pd.read_json(file_path)
|
| 92 |
df = df.replace(to_replace="", value=np.nan).dropna(axis=0) # remove null values
|
| 93 |
|
|
|
|
| 122 |
# index = pickle.loads(file.readlines())
|
| 123 |
return index
|
| 124 |
else:
|
| 125 |
+
documents = self.prepare_data(r"./assets/regItems.json")
|
| 126 |
#documents = SimpleDirectoryReader(input_dir="./assets/pdf").load_data()
|
| 127 |
|
| 128 |
index = GPTVectorStoreIndex.from_documents(
|