Vaishnav14220 commited on
Commit
904862a
·
1 Parent(s): 820ef75

Make 3D SDF download button more visible with better labels

Browse files
Files changed (1) hide show
  1. app.py +12 -5
app.py CHANGED
@@ -103,7 +103,14 @@ def name_to_3d_molecule(name: str) -> tuple:
103
  <p><strong>SMILES:</strong> {canonical_smiles}</p>
104
  <img src="data:image/png;base64,{img_str}" style="max-width: 100%; border: 1px solid #ddd; border-radius: 8px; padding: 10px; background: white;">
105
  <p style="margin-top: 10px; color: #666;">2D Structure Preview</p>
106
- <p style="margin-top: 10px; color: #28a745; font-weight: bold;">✓ 3D SDF file ready for download below</p>
 
 
 
 
 
 
 
107
  </div>
108
  """
109
 
@@ -156,13 +163,13 @@ tpsa_interface = gr.Interface(
156
 
157
  molecule_3d_interface = gr.Interface(
158
  fn=name_to_3d_molecule,
159
- inputs=gr.Textbox(label="Chemical Name", placeholder="e.g., benzene, aspirin, caffeine"),
160
  outputs=[
161
- gr.HTML(label="Molecule Viewer"),
162
- gr.File(label="Download 3D SDF File")
163
  ],
164
  api_name="name_to_molecule",
165
- description="Convert a chemical name to a 2D visualization and download 3D SDF file with coordinates.",
166
  cache_examples=False,
167
  )
168
 
 
103
  <p><strong>SMILES:</strong> {canonical_smiles}</p>
104
  <img src="data:image/png;base64,{img_str}" style="max-width: 100%; border: 1px solid #ddd; border-radius: 8px; padding: 10px; background: white;">
105
  <p style="margin-top: 10px; color: #666;">2D Structure Preview</p>
106
+ <div style="margin-top: 20px; padding: 15px; background-color: #d4edda; border: 2px solid #28a745; border-radius: 8px;">
107
+ <p style="color: #155724; font-size: 16px; font-weight: bold; margin: 0;">
108
+ ✓ 3D SDF File Generated Successfully!
109
+ </p>
110
+ <p style="color: #155724; margin: 5px 0 0 0;">
111
+ Scroll down to download the 3D SDF file with optimized coordinates
112
+ </p>
113
+ </div>
114
  </div>
115
  """
116
 
 
163
 
164
  molecule_3d_interface = gr.Interface(
165
  fn=name_to_3d_molecule,
166
+ inputs=gr.Textbox(label="Chemical Name", placeholder="e.g., benzene, aspirin, caffeine, glucose"),
167
  outputs=[
168
+ gr.HTML(label="2D Preview"),
169
+ gr.File(label="📥 Download 3D SDF File (with optimized 3D coordinates)")
170
  ],
171
  api_name="name_to_molecule",
172
+ description="Get 2D structure preview and download 3D SDF file with optimized molecular coordinates. The SDF file can be opened in PyMOL, Avogadro, ChimeraX, or other molecular viewers.",
173
  cache_examples=False,
174
  )
175