Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,7 +15,7 @@ from llama_index.core.objects import ObjectIndex
|
|
| 15 |
from llama_index.core.agent import ReActAgent
|
| 16 |
|
| 17 |
# Function to process files and create document tools
|
| 18 |
-
|
| 19 |
documents = SimpleDirectoryReader(input_files=[document_fp]).load_data()
|
| 20 |
|
| 21 |
Settings.llm = Groq(model="mixtral-8x7b-32768")
|
|
@@ -59,7 +59,7 @@ def main():
|
|
| 59 |
paper_to_tools_dict = {}
|
| 60 |
for paper in tex_files:
|
| 61 |
path = Path(paper)
|
| 62 |
-
vector_tool =
|
| 63 |
paper_to_tools_dict[path.stem] = [vector_tool]
|
| 64 |
|
| 65 |
initial_tools = [t for paper in tex_files for t in paper_to_tools_dict[Path(paper).stem]]
|
|
|
|
| 15 |
from llama_index.core.agent import ReActAgent
|
| 16 |
|
| 17 |
# Function to process files and create document tools
|
| 18 |
+
def create_doc_tools(document_fp: str, doc_name: str, verbose: bool = True) -> Tuple[QueryEngineTool,]:
|
| 19 |
documents = SimpleDirectoryReader(input_files=[document_fp]).load_data()
|
| 20 |
|
| 21 |
Settings.llm = Groq(model="mixtral-8x7b-32768")
|
|
|
|
| 59 |
paper_to_tools_dict = {}
|
| 60 |
for paper in tex_files:
|
| 61 |
path = Path(paper)
|
| 62 |
+
vector_tool = create_doc_tools(doc_name=path.stem, document_fp=path)
|
| 63 |
paper_to_tools_dict[path.stem] = [vector_tool]
|
| 64 |
|
| 65 |
initial_tools = [t for paper in tex_files for t in paper_to_tools_dict[Path(paper).stem]]
|