Commit
·
a9beafd
1
Parent(s):
03099f1
activate logging to w&b
Browse files- app.py +5 -2
- requirements.txt +1 -0
app.py
CHANGED
@@ -8,6 +8,7 @@ import pandas as pd
|
|
8 |
import streamlit as st
|
9 |
from IPython.core.display import HTML
|
10 |
from PIL import Image
|
|
|
11 |
from chemcrow.agents import ChemCrow, make_tools
|
12 |
from chemcrow.frontend.streamlit_callback_handler import \
|
13 |
StreamlitCallbackHandlerChem
|
@@ -18,6 +19,7 @@ from dotenv import load_dotenv
|
|
18 |
load_dotenv()
|
19 |
ss = st.session_state
|
20 |
|
|
|
21 |
|
22 |
icon = Image.open('assets/logo0.png')
|
23 |
st.set_page_config(
|
@@ -95,8 +97,9 @@ if prompt := st.chat_input():
|
|
95 |
output_placeholder=st.session_state
|
96 |
)
|
97 |
try:
|
98 |
-
|
99 |
-
|
|
|
100 |
except:
|
101 |
st.write("Please input a valid OpenAI API key.")
|
102 |
|
|
|
8 |
import streamlit as st
|
9 |
from IPython.core.display import HTML
|
10 |
from PIL import Image
|
11 |
+
from langchain.callbacks import wandb_tracing_enabled
|
12 |
from chemcrow.agents import ChemCrow, make_tools
|
13 |
from chemcrow.frontend.streamlit_callback_handler import \
|
14 |
StreamlitCallbackHandlerChem
|
|
|
19 |
load_dotenv()
|
20 |
ss = st.session_state
|
21 |
|
22 |
+
os.environ["WANDB_PROJECT"] = "cc-langchain-testing"
|
23 |
|
24 |
icon = Image.open('assets/logo0.png')
|
25 |
st.set_page_config(
|
|
|
97 |
output_placeholder=st.session_state
|
98 |
)
|
99 |
try:
|
100 |
+
with wandb_tracing_enabled():
|
101 |
+
response = agent.run(prompt, callbacks=[st_callback])
|
102 |
+
st.write(response)
|
103 |
except:
|
104 |
st.write("Please input a valid OpenAI API key.")
|
105 |
|
requirements.txt
CHANGED
@@ -4,4 +4,5 @@ streamlit
|
|
4 |
python-dotenv
|
5 |
duckduckgo-search
|
6 |
wikipedia
|
|
|
7 |
chemcrow==0.3.7
|
|
|
4 |
python-dotenv
|
5 |
duckduckgo-search
|
6 |
wikipedia
|
7 |
+
wandb
|
8 |
chemcrow==0.3.7
|