Update app.py
Browse files
app.py
CHANGED
@@ -22,7 +22,7 @@ from dotenv import load_dotenv, find_dotenv
|
|
22 |
_ = load_dotenv(find_dotenv())
|
23 |
|
24 |
#openai.api_key = os.environ["OPENAI_API_KEY"]
|
25 |
-
|
26 |
|
27 |
os.environ["LANGCHAIN_WANDB_TRACING"] = "true"
|
28 |
os.environ["WANDB_PROJECT"] = "openai-llm-rag"
|
@@ -157,9 +157,9 @@ def invoke(openai_api_key, rag_option, prompt):
|
|
157 |
except Exception as e:
|
158 |
completion = e
|
159 |
raise gr.Error(e)
|
160 |
-
|
161 |
#wandb_log(prompt, completion, rag_option)
|
162 |
-
|
163 |
return completion
|
164 |
|
165 |
description = """<strong>Overview:</strong> Context-aware multimodal reasoning application using a <strong>large language model (LLM)</strong> with
|
|
|
22 |
_ = load_dotenv(find_dotenv())
|
23 |
|
24 |
#openai.api_key = os.environ["OPENAI_API_KEY"]
|
25 |
+
WANDB_API_KEY = os.environ["WANDB_API_KEY"]
|
26 |
|
27 |
os.environ["LANGCHAIN_WANDB_TRACING"] = "true"
|
28 |
os.environ["WANDB_PROJECT"] = "openai-llm-rag"
|
|
|
157 |
except Exception as e:
|
158 |
completion = e
|
159 |
raise gr.Error(e)
|
160 |
+
finally:
|
161 |
#wandb_log(prompt, completion, rag_option)
|
162 |
+
wandb.finish()
|
163 |
return completion
|
164 |
|
165 |
description = """<strong>Overview:</strong> Context-aware multimodal reasoning application using a <strong>large language model (LLM)</strong> with
|