Spaces:
Running
Running
Enzo Reis de Oliveira
commited on
Commit
·
f3e37c7
1
Parent(s):
5465560
Correcting title
Browse files
app.py
CHANGED
@@ -51,16 +51,16 @@ def process_inputs(smiles: str, file_obj):
|
|
51 |
df_out.to_csv("embeddings.csv", index=False)
|
52 |
return json.dumps(vec), gr.update(value="embeddings.csv", visible=True)
|
53 |
except Exception as e:
|
54 |
-
return f"Error
|
55 |
|
56 |
# 4) Build the Gradio Blocks interface
|
57 |
with gr.Blocks() as demo:
|
58 |
gr.Markdown(
|
59 |
"""
|
60 |
-
# SMI-TED
|
61 |
**Single mode:** paste a SMILES string in the left box.
|
62 |
**Batch mode:** upload a CSV file where each row has a SMILES in the first column.
|
63 |
-
In both cases, an `embeddings.csv` file will be
|
64 |
"""
|
65 |
)
|
66 |
|
@@ -68,7 +68,7 @@ with gr.Blocks() as demo:
|
|
68 |
smiles_in = gr.Textbox(label="SMILES (single mode)", placeholder="e.g. CCO")
|
69 |
file_in = gr.File(label="SMILES CSV (batch mode)", file_types=[".csv"])
|
70 |
|
71 |
-
generate_btn = gr.Button("
|
72 |
|
73 |
with gr.Row():
|
74 |
output_msg = gr.Textbox(label="Message / Embedding (JSON)", interactive=False, lines=2)
|
|
|
51 |
df_out.to_csv("embeddings.csv", index=False)
|
52 |
return json.dumps(vec), gr.update(value="embeddings.csv", visible=True)
|
53 |
except Exception as e:
|
54 |
+
return f"Error extracting embedding: {e}", gr.update(visible=False)
|
55 |
|
56 |
# 4) Build the Gradio Blocks interface
|
57 |
with gr.Blocks() as demo:
|
58 |
gr.Markdown(
|
59 |
"""
|
60 |
+
# SMI-TED-Embeddings-Extraction
|
61 |
**Single mode:** paste a SMILES string in the left box.
|
62 |
**Batch mode:** upload a CSV file where each row has a SMILES in the first column.
|
63 |
+
In both cases, an `embeddings.csv` file will be extracted for download, with the first column as SMILES and the embedding values in the following columns.
|
64 |
"""
|
65 |
)
|
66 |
|
|
|
68 |
smiles_in = gr.Textbox(label="SMILES (single mode)", placeholder="e.g. CCO")
|
69 |
file_in = gr.File(label="SMILES CSV (batch mode)", file_types=[".csv"])
|
70 |
|
71 |
+
generate_btn = gr.Button("Extract Embeddings")
|
72 |
|
73 |
with gr.Row():
|
74 |
output_msg = gr.Textbox(label="Message / Embedding (JSON)", interactive=False, lines=2)
|