Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,7 +18,7 @@ from llama_index.core.agent import ReActAgent
|
|
| 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")
|
| 22 |
Settings.embed_model = HuggingFaceEmbedding(model_name="BAAI/bge-large-en-v1.5")
|
| 23 |
|
| 24 |
load_dir_path = f"/home/user/app/agentic_index/{doc_name}"
|
|
@@ -52,6 +52,8 @@ def main():
|
|
| 52 |
# API Key input
|
| 53 |
apikey = st.text_input("Enter your Groq API Key", type="password")
|
| 54 |
|
|
|
|
|
|
|
| 55 |
if apikey:
|
| 56 |
directory = '/home/user/app/rag_docs_final_review_tex_merged'
|
| 57 |
tex_files = find_tex_files(directory)
|
|
@@ -71,7 +73,6 @@ def main():
|
|
| 71 |
|
| 72 |
obj_retriever = obj_index.as_retriever(similarity_top_k=6)
|
| 73 |
|
| 74 |
-
llm = Groq(model="mixtral-8x7b-32768", api_key = apikey)
|
| 75 |
|
| 76 |
context = """You are an agent designed to answer scientific queries over a set of given documents.
|
| 77 |
Please always use the tools provided to answer a question. Do not rely on prior knowledge.
|
|
|
|
| 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", api_key = apikey)
|
| 22 |
Settings.embed_model = HuggingFaceEmbedding(model_name="BAAI/bge-large-en-v1.5")
|
| 23 |
|
| 24 |
load_dir_path = f"/home/user/app/agentic_index/{doc_name}"
|
|
|
|
| 52 |
# API Key input
|
| 53 |
apikey = st.text_input("Enter your Groq API Key", type="password")
|
| 54 |
|
| 55 |
+
llm = Groq(model="mixtral-8x7b-32768", api_key = apikey)
|
| 56 |
+
|
| 57 |
if apikey:
|
| 58 |
directory = '/home/user/app/rag_docs_final_review_tex_merged'
|
| 59 |
tex_files = find_tex_files(directory)
|
|
|
|
| 73 |
|
| 74 |
obj_retriever = obj_index.as_retriever(similarity_top_k=6)
|
| 75 |
|
|
|
|
| 76 |
|
| 77 |
context = """You are an agent designed to answer scientific queries over a set of given documents.
|
| 78 |
Please always use the tools provided to answer a question. Do not rely on prior knowledge.
|