Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,6 @@ import gradio as gr
|
|
| 2 |
import spaces
|
| 3 |
import os
|
| 4 |
from pathlib import Path
|
| 5 |
-
from llama_index.core.selectors import LLMSingleSelector
|
| 6 |
from llama_index.core.tools import QueryEngineTool
|
| 7 |
from llama_index.core import VectorStoreIndex
|
| 8 |
from llama_index.core import Settings
|
|
@@ -21,7 +20,7 @@ def create_doc_tools(document_fp: str, doc_name: str, verbose: bool = True) -> T
|
|
| 21 |
documents = SimpleDirectoryReader(input_files=[document_fp]).load_data()
|
| 22 |
|
| 23 |
Settings.llm = Groq(model="mixtral-8x7b-32768")
|
| 24 |
-
Settings.embed_model = HuggingFaceEmbedding(model_name="
|
| 25 |
|
| 26 |
load_dir_path = f"/home/user/app/agentic_index_st/{doc_name}"
|
| 27 |
storage_context = StorageContext.from_defaults(persist_dir=load_dir_path)
|
|
|
|
| 2 |
import spaces
|
| 3 |
import os
|
| 4 |
from pathlib import Path
|
|
|
|
| 5 |
from llama_index.core.tools import QueryEngineTool
|
| 6 |
from llama_index.core import VectorStoreIndex
|
| 7 |
from llama_index.core import Settings
|
|
|
|
| 20 |
documents = SimpleDirectoryReader(input_files=[document_fp]).load_data()
|
| 21 |
|
| 22 |
Settings.llm = Groq(model="mixtral-8x7b-32768")
|
| 23 |
+
Settings.embed_model = HuggingFaceEmbedding(model_name="sentence-transformers/all-mpnet-base-v2")
|
| 24 |
|
| 25 |
load_dir_path = f"/home/user/app/agentic_index_st/{doc_name}"
|
| 26 |
storage_context = StorageContext.from_defaults(persist_dir=load_dir_path)
|