BrightBlueCheese
commited on
Commit
•
c57aa77
1
Parent(s):
3e413da
app
Browse files- .ipynb_checkpoints/app-checkpoint.py +1 -1
- Untitled.ipynb +11 -7
- app.py +1 -1
.ipynb_checkpoints/app-checkpoint.py
CHANGED
@@ -43,7 +43,7 @@ torch.manual_seed(1004)
|
|
43 |
np.random.seed(1004)
|
44 |
|
45 |
st.title('Sol-LLaMA')
|
46 |
-
smiles_str = st.text_area('Enter SMILE string')
|
47 |
|
48 |
file_path = './smiles_str.txt'
|
49 |
# # Open the file in write mode ('w') and write the content
|
|
|
43 |
np.random.seed(1004)
|
44 |
|
45 |
st.title('Sol-LLaMA')
|
46 |
+
smiles_str = st.text_area('Enter SMILE string', value='CC(=C=C(C)C)C')
|
47 |
|
48 |
file_path = './smiles_str.txt'
|
49 |
# # Open the file in write mode ('w') and write the content
|
Untitled.ipynb
CHANGED
@@ -412,7 +412,7 @@
|
|
412 |
},
|
413 |
{
|
414 |
"cell_type": "code",
|
415 |
-
"execution_count":
|
416 |
"id": "a6d6145b-d5f9-44e4-85ca-f27b8c8a339d",
|
417 |
"metadata": {},
|
418 |
"outputs": [],
|
@@ -426,12 +426,14 @@
|
|
426 |
" v_attention_mask = v_batch['attention_mask'].to(device)\n",
|
427 |
" # v_y_labels = v_batch['labels'].to(device)\n",
|
428 |
" v_y_logits = local_model_ft(input_ids=v_input_ids, attention_mask=v_attention_mask)\n",
|
429 |
-
" list_predictions.append(v_y_logits[0].tolist())"
|
|
|
|
|
430 |
]
|
431 |
},
|
432 |
{
|
433 |
"cell_type": "code",
|
434 |
-
"execution_count":
|
435 |
"id": "7bc3e296-6871-45fb-8459-78eadc36bb61",
|
436 |
"metadata": {
|
437 |
"scrolled": true
|
@@ -458,6 +460,7 @@
|
|
458 |
" <thead>\n",
|
459 |
" <tr style=\"text-align: right;\">\n",
|
460 |
" <th></th>\n",
|
|
|
461 |
" <th>E</th>\n",
|
462 |
" <th>S</th>\n",
|
463 |
" <th>A</th>\n",
|
@@ -468,6 +471,7 @@
|
|
468 |
" <tbody>\n",
|
469 |
" <tr>\n",
|
470 |
" <th>0</th>\n",
|
|
|
471 |
" <td>0.352832</td>\n",
|
472 |
" <td>-0.380014</td>\n",
|
473 |
" <td>-0.954426</td>\n",
|
@@ -479,17 +483,17 @@
|
|
479 |
"</div>"
|
480 |
],
|
481 |
"text/plain": [
|
482 |
-
"
|
483 |
-
"0 0.352832 -0.380014 -0.954426 -1.511138 1.032684"
|
484 |
]
|
485 |
},
|
486 |
-
"execution_count":
|
487 |
"metadata": {},
|
488 |
"output_type": "execute_result"
|
489 |
}
|
490 |
],
|
491 |
"source": [
|
492 |
-
"df = pd.DataFrame(list_predictions, columns=[\"E\", \"S\", \"A\", \"B\", \"V\"])\n",
|
493 |
"df"
|
494 |
]
|
495 |
},
|
|
|
412 |
},
|
413 |
{
|
414 |
"cell_type": "code",
|
415 |
+
"execution_count": 29,
|
416 |
"id": "a6d6145b-d5f9-44e4-85ca-f27b8c8a339d",
|
417 |
"metadata": {},
|
418 |
"outputs": [],
|
|
|
426 |
" v_attention_mask = v_batch['attention_mask'].to(device)\n",
|
427 |
" # v_y_labels = v_batch['labels'].to(device)\n",
|
428 |
" v_y_logits = local_model_ft(input_ids=v_input_ids, attention_mask=v_attention_mask)\n",
|
429 |
+
" list_predictions.append(v_y_logits[0].tolist())\n",
|
430 |
+
"\n",
|
431 |
+
"list_predictions[0].insert(0, smiles_str)"
|
432 |
]
|
433 |
},
|
434 |
{
|
435 |
"cell_type": "code",
|
436 |
+
"execution_count": 30,
|
437 |
"id": "7bc3e296-6871-45fb-8459-78eadc36bb61",
|
438 |
"metadata": {
|
439 |
"scrolled": true
|
|
|
460 |
" <thead>\n",
|
461 |
" <tr style=\"text-align: right;\">\n",
|
462 |
" <th></th>\n",
|
463 |
+
" <th>SMILES</th>\n",
|
464 |
" <th>E</th>\n",
|
465 |
" <th>S</th>\n",
|
466 |
" <th>A</th>\n",
|
|
|
471 |
" <tbody>\n",
|
472 |
" <tr>\n",
|
473 |
" <th>0</th>\n",
|
474 |
+
" <td>COO2</td>\n",
|
475 |
" <td>0.352832</td>\n",
|
476 |
" <td>-0.380014</td>\n",
|
477 |
" <td>-0.954426</td>\n",
|
|
|
483 |
"</div>"
|
484 |
],
|
485 |
"text/plain": [
|
486 |
+
" SMILES E S A B V\n",
|
487 |
+
"0 COO2 0.352832 -0.380014 -0.954426 -1.511138 1.032684"
|
488 |
]
|
489 |
},
|
490 |
+
"execution_count": 30,
|
491 |
"metadata": {},
|
492 |
"output_type": "execute_result"
|
493 |
}
|
494 |
],
|
495 |
"source": [
|
496 |
+
"df = pd.DataFrame(list_predictions, columns=[\"SMILES\", \"E\", \"S\", \"A\", \"B\", \"V\"])\n",
|
497 |
"df"
|
498 |
]
|
499 |
},
|
app.py
CHANGED
@@ -43,7 +43,7 @@ torch.manual_seed(1004)
|
|
43 |
np.random.seed(1004)
|
44 |
|
45 |
st.title('Sol-LLaMA')
|
46 |
-
smiles_str = st.text_area('Enter SMILE string')
|
47 |
|
48 |
file_path = './smiles_str.txt'
|
49 |
# # Open the file in write mode ('w') and write the content
|
|
|
43 |
np.random.seed(1004)
|
44 |
|
45 |
st.title('Sol-LLaMA')
|
46 |
+
smiles_str = st.text_area('Enter SMILE string', value='CC(=C=C(C)C)C')
|
47 |
|
48 |
file_path = './smiles_str.txt'
|
49 |
# # Open the file in write mode ('w') and write the content
|