Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -16,8 +16,6 @@ from langchain.vectorstores import MongoDBAtlasVectorSearch
|
|
16 |
|
17 |
from pymongo import MongoClient
|
18 |
|
19 |
-
from wandb.integration.openai import autolog
|
20 |
-
|
21 |
from dotenv import load_dotenv, find_dotenv
|
22 |
_ = load_dotenv(find_dotenv())
|
23 |
|
@@ -124,7 +122,6 @@ def invoke(openai_api_key, rag_option, prompt):
|
|
124 |
raise gr.Error("Retrieval Augmented Generation is required.")
|
125 |
if (prompt == ""):
|
126 |
raise gr.Error("Prompt is required.")
|
127 |
-
autolog({"project": "openai-llm-rag", "__name__": "test"})
|
128 |
completion = ""
|
129 |
try:
|
130 |
llm = ChatOpenAI(model_name = config["model"],
|
@@ -147,9 +144,9 @@ def invoke(openai_api_key, rag_option, prompt):
|
|
147 |
except Exception as e:
|
148 |
completion = e
|
149 |
raise gr.Error(e)
|
150 |
-
finally:
|
151 |
#wandb.finish()
|
152 |
-
autolog.disable()
|
153 |
return completion
|
154 |
|
155 |
description = """<strong>Overview:</strong> Context-aware multimodal reasoning application using a <strong>large language model (LLM)</strong> with
|
|
|
16 |
|
17 |
from pymongo import MongoClient
|
18 |
|
|
|
|
|
19 |
from dotenv import load_dotenv, find_dotenv
|
20 |
_ = load_dotenv(find_dotenv())
|
21 |
|
|
|
122 |
raise gr.Error("Retrieval Augmented Generation is required.")
|
123 |
if (prompt == ""):
|
124 |
raise gr.Error("Prompt is required.")
|
|
|
125 |
completion = ""
|
126 |
try:
|
127 |
llm = ChatOpenAI(model_name = config["model"],
|
|
|
144 |
except Exception as e:
|
145 |
completion = e
|
146 |
raise gr.Error(e)
|
147 |
+
#finally:
|
148 |
#wandb.finish()
|
149 |
+
#autolog.disable()
|
150 |
return completion
|
151 |
|
152 |
description = """<strong>Overview:</strong> Context-aware multimodal reasoning application using a <strong>large language model (LLM)</strong> with
|