Spaces:
Running
Running
doncamilom
commited on
Commit
•
4d247b4
1
Parent(s):
459f62c
cc update + fix openaikey
Browse files- app.py +7 -7
- requirements.txt +1 -1
app.py
CHANGED
@@ -39,12 +39,15 @@ st.markdown(
|
|
39 |
unsafe_allow_html=True,
|
40 |
)
|
41 |
|
|
|
42 |
agent = ChemCrow(
|
43 |
model='gpt-4',
|
|
|
44 |
temp=0.1,
|
45 |
openai_api_key=ss.get('api_key'),
|
46 |
api_keys={
|
47 |
-
'
|
|
|
48 |
}
|
49 |
).agent_executor
|
50 |
|
@@ -67,7 +70,7 @@ def run_prompt(prompt):
|
|
67 |
with st.chat_message("assistant"):
|
68 |
st_callback = StreamlitCallbackHandlerChem(
|
69 |
st.container(),
|
70 |
-
max_thought_containers =
|
71 |
collapse_completed_thoughts = False,
|
72 |
output_placeholder=ss
|
73 |
)
|
@@ -93,10 +96,7 @@ pre_prompts = [
|
|
93 |
'What is the boiling point of the reaction product between '
|
94 |
'isoamyl alcohol and acetic acid?'
|
95 |
),
|
96 |
-
|
97 |
-
'Find 3 alkaloids in the cannabis plant, '
|
98 |
-
'and calculate their similarity with caffein'
|
99 |
-
)
|
100 |
]
|
101 |
|
102 |
# sidebar
|
@@ -132,7 +132,7 @@ with st.sidebar:
|
|
132 |
on_click=lambda: run_prompt(pre_prompts[2]),
|
133 |
)
|
134 |
st.button(
|
135 |
-
'
|
136 |
on_click=lambda: run_prompt(pre_prompts[3]),
|
137 |
)
|
138 |
|
|
|
39 |
unsafe_allow_html=True,
|
40 |
)
|
41 |
|
42 |
+
os.environ['OPENAI_API_KEY'] = ss.get('api_key')
|
43 |
agent = ChemCrow(
|
44 |
model='gpt-4',
|
45 |
+
tools_model='gpt-4-0613',
|
46 |
temp=0.1,
|
47 |
openai_api_key=ss.get('api_key'),
|
48 |
api_keys={
|
49 |
+
'RXN4CHEM_API_KEY': st.secrets['RXN4CHEM_API_KEY'],
|
50 |
+
'CHEMSPACE_API_KEY': st.secrets['CHEMSPACE_API_KEY']
|
51 |
}
|
52 |
).agent_executor
|
53 |
|
|
|
70 |
with st.chat_message("assistant"):
|
71 |
st_callback = StreamlitCallbackHandlerChem(
|
72 |
st.container(),
|
73 |
+
max_thought_containers = 3,
|
74 |
collapse_completed_thoughts = False,
|
75 |
output_placeholder=ss
|
76 |
)
|
|
|
96 |
'What is the boiling point of the reaction product between '
|
97 |
'isoamyl alcohol and acetic acid?'
|
98 |
),
|
99 |
+
'Tell me how to synthesize vanilline, and the price of the precursors.'
|
|
|
|
|
|
|
100 |
]
|
101 |
|
102 |
# sidebar
|
|
|
132 |
on_click=lambda: run_prompt(pre_prompts[2]),
|
133 |
)
|
134 |
st.button(
|
135 |
+
'Synthesize molecule with price of precursors',
|
136 |
on_click=lambda: run_prompt(pre_prompts[3]),
|
137 |
)
|
138 |
|
requirements.txt
CHANGED
@@ -5,7 +5,7 @@ python-dotenv
|
|
5 |
duckduckgo-search
|
6 |
wikipedia
|
7 |
wandb
|
8 |
-
chemcrow==0.3.
|
9 |
pydantic==1.10.7
|
10 |
langchain==0.0.275
|
11 |
typing-inspect==0.8.0
|
|
|
5 |
duckduckgo-search
|
6 |
wikipedia
|
7 |
wandb
|
8 |
+
chemcrow==0.3.21
|
9 |
pydantic==1.10.7
|
10 |
langchain==0.0.275
|
11 |
typing-inspect==0.8.0
|