mcnaughtonadm commited on
Commit
82fd84a
·
1 Parent(s): db547d9

Adding citation information and Title/Description

Browse files
Files changed (1) hide show
  1. app.py +36 -2
app.py CHANGED
@@ -12,6 +12,23 @@ MODEL_API_KEY_MAP = {
12
  "claude-3-opus-20240229": "ANTHROPIC_API_KEY",
13
  "claude-3-sonnet-20240229": "ANTHROPIC_API_KEY",
14
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
 
17
  def agent_fn(prompt, model_name, api_key=None):
@@ -29,7 +46,9 @@ def agent_fn(prompt, model_name, api_key=None):
29
  return f"Error: {e}"
30
 
31
 
32
- with gr.Blocks() as iface:
 
 
33
  with gr.Row():
34
  model_name_dropdown = gr.Dropdown(
35
  list(MODEL_API_KEY_MAP.keys()), label="Select Model"
@@ -40,10 +59,25 @@ with gr.Blocks() as iface:
40
  )
41
 
42
  with gr.Row():
43
- submit_button = gr.Button("Submit")
 
 
 
 
 
 
 
 
 
 
 
 
 
44
 
45
  response_output = gr.Textbox(label="Agent Response")
46
 
 
 
47
  # Event Triggers
48
  model_name_dropdown.change(
49
  lambda x: gr.update(visible=MODEL_API_KEY_MAP.get(x) is not None),
 
12
  "claude-3-opus-20240229": "ANTHROPIC_API_KEY",
13
  "claude-3-sonnet-20240229": "ANTHROPIC_API_KEY",
14
  }
15
+ TITLE = """CACTUS 🌵: Chemistry Agent Connecting Tool-Usage to Science"""
16
+ DESC = """
17
+ CACTUS is an innovative tool-augmented language model designed to assist researchers and chemists in various chemistry-related tasks. By integrating state-of-the-art language models with a suite of powerful cheminformatics tools, CACTUS provides an intelligent and efficient solution for exploring chemical space, predicting molecular properties, and accelerating drug discovery. Just as the cactus thrives in the harsh desert environment, adapting to limited resources and extreme conditions, CACTUS has been implemented by Pacific Northwest National Laboratory (PNNL) Scientists to navigate the complex landscape of chemical data and extract valuable insights.
18
+ """
19
+ CITE = """**Citation**
20
+
21
+ If you use CACTUS in your research, please cite our preprint:
22
+ ```bibtex
23
+ @article{mcnaughton2024cactus,
24
+ title={CACTUS: Chemistry Agent Connecting Tool-Usage to Science},
25
+ author={Andrew D. McNaughton and Gautham Ramalaxmi and Agustin Kruel and Carter R. Knutson and Rohith A. Varikoti and Neeraj Kumar},
26
+ year={2024},
27
+ eprint={2405.00972},
28
+ archivePrefix={arXiv},
29
+ primaryClass={cs.CL}
30
+ }
31
+ ```"""
32
 
33
 
34
  def agent_fn(prompt, model_name, api_key=None):
 
46
  return f"Error: {e}"
47
 
48
 
49
+ with gr.Blocks(title=TITLE) as iface:
50
+ gr.Markdown(DESC)
51
+
52
  with gr.Row():
53
  model_name_dropdown = gr.Dropdown(
54
  list(MODEL_API_KEY_MAP.keys()), label="Select Model"
 
59
  )
60
 
61
  with gr.Row():
62
+ submit_button = gr.Button("Submit", variant="primary")
63
+
64
+ with gr.Row(): # Row for sample questions
65
+ sample_questions = [
66
+ "What is the molecular weight of the SMILES: CCO ?",
67
+ "Does the SMILES: C1CCOC1 , trigger the PAINS filter?",
68
+ "Calculate the LogP of the smiles: CCCCCCC=C",
69
+ ]
70
+ for question in sample_questions:
71
+ gr.Button(question).click(
72
+ lambda q=question: gr.Textbox.update(value=q),
73
+ None,
74
+ prompt_input,
75
+ )
76
 
77
  response_output = gr.Textbox(label="Agent Response")
78
 
79
+ gr.Markdown(CITE)
80
+
81
  # Event Triggers
82
  model_name_dropdown.change(
83
  lambda x: gr.update(visible=MODEL_API_KEY_MAP.get(x) is not None),