shgao commited on
Commit
5f7d104
·
1 Parent(s): 6d950e0
Files changed (1) hide show
  1. app.py +84 -22
app.py CHANGED
@@ -960,6 +960,18 @@ centered_col_css = """
960
  width: 100% !important; /* Occupy full width of its column */
961
  white-space: normal !important; /* Allow text to wrap onto multiple lines */
962
  }
 
 
 
 
 
 
 
 
 
 
 
 
963
  .criteria-radio-score-label [role="radiogroup"],
964
  .criteria-radio-score-label .gr-radio-group,
965
  .criteria-radio-score-label .flex {
@@ -1021,11 +1033,38 @@ with gr.Blocks(css=centered_col_css) as demo:
1021
  with gr.Column(visible=True, elem_id="page-1") as page_minus1:
1022
  gr.HTML("""
1023
  <div>
1024
- <h1>TxAgent Portal: AI Evaluation and Crowdsourcing of Therapeutic Questions</h1>
1025
  </div>
1026
  """)
1027
- # with gr.Row(elem_classes=["center-row"]):
1028
- # 第一行:并排放两个按钮
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1029
  with gr.Column(scale=1):
1030
  participate_eval_btn = gr.Button(
1031
  value="Evaluate TxAgent",
@@ -1044,27 +1083,32 @@ with gr.Blocks(css=centered_col_css) as demo:
1044
  Thank you for helping improve TxAgent!
1045
  """
1046
  )
1047
- with gr.Column(scale=1):
1048
- submit_questions_btn = gr.Button(
1049
- value="Submit Your Therapeutic Questions",
1050
- variant="primary",
1051
- size="lg",
1052
- elem_id="submit-btn"
1053
- )
 
 
 
 
1054
 
1055
  # with gr.Row(elem_classes=["center-row"]):
1056
  # 第二行:分别放两段说明文字
1057
- with gr.Column(scale=1):
1058
- gr.Markdown(
1059
- """
1060
- By submitting therapeutic questions, you will:
1061
- - Help identify edge cases and blind spots for AI models.
1062
- - Help extend AI models to reason in new domains.
1063
- - Directly shape future model improvements.
 
 
 
 
1064
 
1065
- We look forward to seeing your feedback!
1066
- """
1067
- )
1068
 
1069
  # Add contact information in Markdown format
1070
  contact_info_markdown = """
@@ -1081,11 +1125,29 @@ with gr.Blocks(css=centered_col_css) as demo:
1081
  # For the Google Form button, we'll use JavaScript to open a new tab.
1082
  # The URL for the Google Form should be replaced with the actual link.
1083
  google_form_url = "https://forms.gle/pYvyvEQQwS5gdupQA"
1084
- submit_questions_btn.click(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1085
  fn=None,
1086
  inputs=None,
1087
  outputs=None,
1088
- js=f"() => {{ window.open('{google_form_url}', '_blank'); }}"
1089
  )
1090
 
1091
  # Page 0: Welcome / Informational page.
 
960
  width: 100% !important; /* Occupy full width of its column */
961
  white-space: normal !important; /* Allow text to wrap onto multiple lines */
962
  }
963
+ #txagent-demo-btn {
964
+ background-color: #4CAF50 !important;
965
+ color: white !important;
966
+ border-color: #4CAF50 !important;
967
+ margin-top: 10px !important;
968
+ }
969
+ #api-key-btn {
970
+ background-color: #FF9800 !important;
971
+ color: white !important;
972
+ border-color: #FF9800 !important;
973
+ margin-top: 10px !important;
974
+ }
975
  .criteria-radio-score-label [role="radiogroup"],
976
  .criteria-radio-score-label .gr-radio-group,
977
  .criteria-radio-score-label .flex {
 
1033
  with gr.Column(visible=True, elem_id="page-1") as page_minus1:
1034
  gr.HTML("""
1035
  <div>
1036
+ <h1>TxAgent: An AI Agent for Therapeutics</h1>
1037
  </div>
1038
  """)
1039
+ # Add TxAgent demo and API key buttons
1040
+ with gr.Column(scale=1):
1041
+ api_key_btn = gr.Button(
1042
+ value="Request Access",
1043
+ variant="secondary",
1044
+ size="lg",
1045
+ elem_id="api-key-btn"
1046
+ )
1047
+ with gr.Column(scale=1):
1048
+ txagent_demo_btn = gr.Button(
1049
+ value="Access TxAgent",
1050
+ variant="secondary",
1051
+ size="lg",
1052
+ elem_id="txagent-demo-btn"
1053
+ )
1054
+
1055
+ gr.Markdown(
1056
+ """
1057
+ For live access to TxAgent, you can:
1058
+ - Access TxAgent if you have an account.
1059
+ - Request access if you do not have an account yet.
1060
+
1061
+ We look forward to your feedback!
1062
+ """
1063
+ )
1064
+
1065
+ # Add extra white space between sections
1066
+ gr.HTML("<br>")
1067
+
1068
  with gr.Column(scale=1):
1069
  participate_eval_btn = gr.Button(
1070
  value="Evaluate TxAgent",
 
1083
  Thank you for helping improve TxAgent!
1084
  """
1085
  )
1086
+
1087
+
1088
+
1089
+
1090
+ # with gr.Column(scale=1):
1091
+ # submit_questions_btn = gr.Button(
1092
+ # value="Submit Your Therapeutic Questions",
1093
+ # variant="primary",
1094
+ # size="lg",
1095
+ # elem_id="submit-btn"
1096
+ # )
1097
 
1098
  # with gr.Row(elem_classes=["center-row"]):
1099
  # 第二行:分别放两段说明文字
1100
+ # with gr.Column(scale=1):
1101
+ # gr.Markdown(
1102
+ # """
1103
+ # By submitting therapeutic questions, you will:
1104
+ # - Help identify edge cases and blind spots for AI models.
1105
+ # - Help extend AI models to reason in new domains.
1106
+ # - Directly shape future model improvements.
1107
+
1108
+ # We look forward to seeing your feedback!
1109
+ # """
1110
+ # )
1111
 
 
 
 
1112
 
1113
  # Add contact information in Markdown format
1114
  contact_info_markdown = """
 
1125
  # For the Google Form button, we'll use JavaScript to open a new tab.
1126
  # The URL for the Google Form should be replaced with the actual link.
1127
  google_form_url = "https://forms.gle/pYvyvEQQwS5gdupQA"
1128
+ # submit_questions_btn.click(
1129
+ # fn=None,
1130
+ # inputs=None,
1131
+ # outputs=None,
1132
+ # js=f"() => {{ window.open('{google_form_url}', '_blank'); }}"
1133
+ # )
1134
+
1135
+ # TxAgent demo button click handler
1136
+ txagent_demo_url = "https://txagent.curebench.ai/"
1137
+ txagent_demo_btn.click(
1138
+ fn=None,
1139
+ inputs=None,
1140
+ outputs=None,
1141
+ js=f"() => {{ window.open('{txagent_demo_url}', '_blank'); }}"
1142
+ )
1143
+
1144
+ # API key application button click handler
1145
+ api_key_url = "https://docs.google.com/forms/d/e/1FAIpQLScEFhgT1X0wOkpWjEOMGpvhDFyIfoSMzJZ2HA9o0F0BaNcQPw/viewform?usp=dialog"
1146
+ api_key_btn.click(
1147
  fn=None,
1148
  inputs=None,
1149
  outputs=None,
1150
+ js=f"() => {{ window.open('{api_key_url}', '_blank'); }}"
1151
  )
1152
 
1153
  # Page 0: Welcome / Informational page.