Zhaohan-Meng commited on
Commit
ae50e4e
Β·
verified Β·
1 Parent(s): abb17a0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +44 -29
app.py CHANGED
@@ -1,4 +1,3 @@
1
- # ─── Patch gradio_client so boolean schemas don’t crash json_schema_to_python_type ───
2
  import gradio_client.utils as _gc_utils
3
  _orig_get_type = _gc_utils.get_type
4
  _orig_json2py = _gc_utils._json_schema_to_python_type
@@ -1024,8 +1023,25 @@ h1{
1024
  justify-content: center;
1025
  }
1026
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1027
 
 
 
 
1028
  }
 
1029
  """
1030
  with gr.Blocks() as demo:
1031
 
@@ -1050,28 +1066,31 @@ with gr.Blocks() as demo:
1050
  # ───────────────────────────────
1051
  # Top links
1052
  # ───────────────────────────────
1053
- gr.Markdown("""
1054
- <div class="publication-links">
1055
-
1056
- <span class="link-block">
1057
- <a href="https://arxiv.org/abs/2406.01651" target="_blank" class="btn-danger">
1058
- <i class="fa-solid fa-file-lines"></i> Paper
1059
- </a>
1060
- </span>
1061
-
1062
- <span class="link-block">
1063
- <a href="https://github.com/ZhaohanM/ExplainBind" target="_blank" class="btn-dark">
1064
- <i class="fa-brands fa-github"></i> Source Code
1065
- </a>
1066
- </span>
1067
-
1068
- <span class="link-block">
1069
- <a href="https://ZhaohanM.github.io/ExplainBind/" target="_blank" class="btn-link">
1070
- <i class="fa-solid fa-globe"></i> Project Page
1071
- </a>
1072
- </span>
1073
- </div>
1074
- """)
 
 
 
1075
 
1076
  # ───────────────────────────────
1077
  # Guidelines
@@ -1143,7 +1162,7 @@ with gr.Blocks() as demo:
1143
  gr.Examples(
1144
  examples=[[
1145
  "MTLSILVAHDLQRVIGFENQLPWHLPNDLKHVKKLSTGHTLVMGRKTFESIGKPLPNRRNVVLTSDTSFNVEGVDVIHSIEDIYQLPGHVFIFGGQTLFEEMIDKVDDMYITVIEGKFRGDTFFPPYTFEDWEVASSVEGKLDEKNTIPHTFLHLIRKK",
1146
- "[C][O][C][=C][C][Branch1][=C][C][C][=C][N][=C][Branch1][C][N][N][=C][Ring1][#Branch1][N][=C][C][Branch1][Ring1][O][C][=C][Ring1][P][O][C]"
1147
  ]],
1148
  inputs=[protein_seq, drug_seq],
1149
  label="Click to load an example",
@@ -1226,9 +1245,5 @@ with gr.Blocks() as demo:
1226
  demo.launch(
1227
  theme=gr.themes.Default(),
1228
  css=css,
1229
- head="""
1230
- <link rel="stylesheet"
1231
- href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
1232
- """,
1233
  show_error=True
1234
- )
 
 
1
  import gradio_client.utils as _gc_utils
2
  _orig_get_type = _gc_utils.get_type
3
  _orig_json2py = _gc_utils._json_schema_to_python_type
 
1023
  justify-content: center;
1024
  }
1025
 
1026
+ .link-btn{
1027
+ display:inline-flex;
1028
+ align-items:center;
1029
+ gap:8px;
1030
+ padding:10px 18px;
1031
+ font-size:14px;
1032
+ font-weight:600;
1033
+ border-radius:9999px;
1034
+ text-decoration:none;
1035
+ background:#e2e8f0;
1036
+ color:#0f172a;
1037
+ transition:all 0.15s ease-in-out;
1038
+ }
1039
 
1040
+ .link-btn:hover{
1041
+ filter:brightness(0.95);
1042
+ transform:translateY(-1px);
1043
  }
1044
+
1045
  """
1046
  with gr.Blocks() as demo:
1047
 
 
1066
  # ───────────────────────────────
1067
  # Top links
1068
  # ───────────────────────────────
1069
+ gr.HTML("""
1070
+ <div style="text-align:center;margin-bottom:32px;">
1071
+ <a class="link-btn project" href="https://zhaohanm.github.io/FusionDTI.github.io/" target="_blank" rel="noopener noreferrer" aria-label="Project Page">
1072
+ <!-- globe icon -->
1073
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
1074
+ <path d="M12 2a10 10 0 1 0 10 10A10.012 10.012 0 0 0 12 2Zm7.93 9h-3.18a15.84 15.84 0 0 0-1.19-5.02A8.02 8.02 0 0 1 19.93 11ZM12 4c.86 0 2.25 1.86 3.01 6H8.99C9.75 5.86 11.14 4 12 4ZM4.07 13h3.18c.2 1.79.66 3.47 1.19 5.02A8.02 8.02 0 0 1 4.07 13Zm3.18-2H4.07A8.02 8.02 0 0 1 8.44 5.98 15.84 15.84 0 0 0 7.25 11Zm1.37 2h6.76c-.76 4.14-2.15 6-3.01 6s-2.25-1.86-3.01-6Zm9.05 0h3.18a8.02 8.02 0 0 1-4.37 5.02 15.84 15.84 0 0 0 1.19-5.02Z"/>
1075
+ </svg>
1076
+ Project Page
1077
+ </a>
1078
+ <a class="link-btn arxiv" href="https://arxiv.org/abs/2406.01651" target="_blank" rel="noopener noreferrer" aria-label="ArXiv: 2406.01651">
1079
+ <!-- arXiv-like paper icon -->
1080
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
1081
+ <path d="M6 2h9l5 5v13a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2Zm8 1.5V8h4.5L14 3.5ZM7 12h10v2H7v-2Zm0 4h10v2H7v-2Zm0-8h6v2H7V8Z"/>
1082
+ </svg>
1083
+ ArXiv: 2406.01651
1084
+ </a>
1085
+ <a class="link-btn github" href="https://github.com/ZhaohanM/ExplainBind" target="_blank" rel="noopener noreferrer" aria-label="GitHub Repo">
1086
+ <!-- GitHub mark -->
1087
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
1088
+ <path d="M12 .5A12 12 0 0 0 0 12.76c0 5.4 3.44 9.98 8.2 11.6.6.12.82-.28.82-.6v-2.3c-3.34.74-4.04-1.44-4.04-1.44-.54-1.38-1.32-1.74-1.32-1.74-1.08-.76.08-.74.08-.74 1.2.08 1.84 1.26 1.84 1.26 1.06 1.86 2.78 1.32 3.46 1.02.1-.8.42-1.32.76-1.62-2.66-.32-5.46-1.36-5.46-6.02 0-1.34.46-2.44 1.22-3.3-.12-.32-.54-1.64.12-3.42 0 0 1-.34 3.32 1.26.96-.28 1.98-.42 3-.42s2.04.14 3 .42c2.32-1.6 3.32-1.26 3.32-1.26.66 1.78.24 3.1.12 3.42.76.86 1.22 1.96 1.22 3.3 0 4.68-2.8 5.68-5.48 6 .44.38.84 1.12.84 2.28v3.38c0 .32.22.74.84.6A12.02 12.02 0 0 0 24 12.76 12 12 0 0 0 12 .5Z"/>
1089
+ </svg>
1090
+ GitHub Repo
1091
+ </a>
1092
+ </div>
1093
+ """)
1094
 
1095
  # ───────────────────────────────
1096
  # Guidelines
 
1162
  gr.Examples(
1163
  examples=[[
1164
  "MTLSILVAHDLQRVIGFENQLPWHLPNDLKHVKKLSTGHTLVMGRKTFESIGKPLPNRRNVVLTSDTSFNVEGVDVIHSIEDIYQLPGHVFIFGGQTLFEEMIDKVDDMYITVIEGKFRGDTFFPPYTFEDWEVASSVEGKLDEKNTIPHTFLHLIRKK",
1165
+ "[C][O][C][=C][C][Branch1][=C][C][C][=C][N][=C][Branch1][C][N][N][=C][Ring1][#Branch1][N][=C][C][Branch1][Ring1][O][C]"
1166
  ]],
1167
  inputs=[protein_seq, drug_seq],
1168
  label="Click to load an example",
 
1245
  demo.launch(
1246
  theme=gr.themes.Default(),
1247
  css=css,
 
 
 
 
1248
  show_error=True
1249
+ )