Spaces:
Sleeping
Sleeping
Khalid Rafiq
commited on
Commit
·
e94fa7b
1
Parent(s):
08eb10f
Add model weights and update app.py with correct paths
Browse files- Gradio_Overall.ipynb → .ipynb_checkpoints/app-checkpoint.ipynb +10 -10
- FlexiPropagator_2025-02-01-04-31-51_431b6c0b_best.pt +3 -0
- FlexiPropagator_2D_2025-01-30-12-11-01_0aee8fb0_best.pt +3 -0
- __pycache__/LSTM_model.cpython-310.pyc +0 -0
- __pycache__/config_adv_dif.cpython-310.pyc +0 -0
- __pycache__/config_burgers.cpython-310.pyc +0 -0
- __pycache__/data_adv_dif.cpython-310.pyc +0 -0
- __pycache__/data_burgers.cpython-310.pyc +0 -0
- __pycache__/model_adv_dif.cpython-310.pyc +0 -0
- __pycache__/model_io_adv_dif.cpython-310.pyc +0 -0
- __pycache__/model_io_burgers.cpython-310.pyc +0 -0
- __pycache__/model_v2.cpython-310.pyc +0 -0
- ae_decoder_weights.pth +3 -0
- ae_encoder_weights.pth +3 -0
- ae_model.pth +3 -0
- app.ipynb +10 -10
- app.py +6 -6
- lstm_weights.pth +3 -0
Gradio_Overall.ipynb → .ipynb_checkpoints/app-checkpoint.ipynb
RENAMED
@@ -2,7 +2,7 @@
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
-
"execution_count":
|
6 |
"id": "bc0b9235-53d3-49f1-a297-e404370cd5d9",
|
7 |
"metadata": {},
|
8 |
"outputs": [
|
@@ -10,7 +10,7 @@
|
|
10 |
"name": "stdout",
|
11 |
"output_type": "stream",
|
12 |
"text": [
|
13 |
-
"* Running on local URL: http://127.0.0.1:
|
14 |
"\n",
|
15 |
"To create a public link, set `share=True` in `launch()`.\n"
|
16 |
]
|
@@ -18,7 +18,7 @@
|
|
18 |
{
|
19 |
"data": {
|
20 |
"text/html": [
|
21 |
-
"<div><iframe src=\"http://127.0.0.1:
|
22 |
],
|
23 |
"text/plain": [
|
24 |
"<IPython.core.display.HTML object>"
|
@@ -31,7 +31,7 @@
|
|
31 |
"data": {
|
32 |
"text/plain": []
|
33 |
},
|
34 |
-
"execution_count":
|
35 |
"metadata": {},
|
36 |
"output_type": "execute_result"
|
37 |
}
|
@@ -65,7 +65,7 @@
|
|
65 |
" return Model(encoder, decoder, propagator)\n",
|
66 |
"\n",
|
67 |
"flexi_prop_model = get_burgers_model(128, 2)\n",
|
68 |
-
"checkpoint = torch.load(\"
|
69 |
"flexi_prop_model.load_state_dict(checkpoint['model_state_dict'])\n",
|
70 |
"flexi_prop_model.eval()\n",
|
71 |
"\n",
|
@@ -75,10 +75,10 @@
|
|
75 |
"ae_model = AE_Model(ae_encoder, ae_decoder)\n",
|
76 |
"lstm_model = PytorchLSTM()\n",
|
77 |
"\n",
|
78 |
-
"ae_encoder.load_state_dict(torch.load(\"
|
79 |
-
"ae_decoder.load_state_dict(torch.load(\"
|
80 |
-
"ae_model.load_state_dict(torch.load(\"
|
81 |
-
"lstm_model.load_state_dict(torch.load(\"
|
82 |
"\n",
|
83 |
"# ========== Helper Functions Burgers ==========\n",
|
84 |
"def exacts_equals_timewindow(t_0, Re, time_window=40):\n",
|
@@ -228,7 +228,7 @@
|
|
228 |
"\n",
|
229 |
"adv_dif_model = get_adv_dif_model(3, 128)\n",
|
230 |
"adv_dif_model, _, _, _ = load_model_adv_dif(\n",
|
231 |
-
" \"
|
232 |
" adv_dif_model\n",
|
233 |
")\n",
|
234 |
"\n",
|
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
+
"execution_count": 1,
|
6 |
"id": "bc0b9235-53d3-49f1-a297-e404370cd5d9",
|
7 |
"metadata": {},
|
8 |
"outputs": [
|
|
|
10 |
"name": "stdout",
|
11 |
"output_type": "stream",
|
12 |
"text": [
|
13 |
+
"* Running on local URL: http://127.0.0.1:7885\n",
|
14 |
"\n",
|
15 |
"To create a public link, set `share=True` in `launch()`.\n"
|
16 |
]
|
|
|
18 |
{
|
19 |
"data": {
|
20 |
"text/html": [
|
21 |
+
"<div><iframe src=\"http://127.0.0.1:7885/\" width=\"100%\" height=\"500\" allow=\"autoplay; camera; microphone; clipboard-read; clipboard-write;\" frameborder=\"0\" allowfullscreen></iframe></div>"
|
22 |
],
|
23 |
"text/plain": [
|
24 |
"<IPython.core.display.HTML object>"
|
|
|
31 |
"data": {
|
32 |
"text/plain": []
|
33 |
},
|
34 |
+
"execution_count": 1,
|
35 |
"metadata": {},
|
36 |
"output_type": "execute_result"
|
37 |
}
|
|
|
65 |
" return Model(encoder, decoder, propagator)\n",
|
66 |
"\n",
|
67 |
"flexi_prop_model = get_burgers_model(128, 2)\n",
|
68 |
+
"checkpoint = torch.load(\"./FlexiPropagator_2025-02-01-10-28-34_3e9656b5_best.pt\", map_location='cpu')\n",
|
69 |
"flexi_prop_model.load_state_dict(checkpoint['model_state_dict'])\n",
|
70 |
"flexi_prop_model.eval()\n",
|
71 |
"\n",
|
|
|
75 |
"ae_model = AE_Model(ae_encoder, ae_decoder)\n",
|
76 |
"lstm_model = PytorchLSTM()\n",
|
77 |
"\n",
|
78 |
+
"ae_encoder.load_state_dict(torch.load(\"./ae_encoder_weights.pth\", map_location='cpu'))\n",
|
79 |
+
"ae_decoder.load_state_dict(torch.load(\"./ae_decoder_weights.pth\", map_location='cpu'))\n",
|
80 |
+
"ae_model.load_state_dict(torch.load(\"./ae_model.pth\", map_location='cpu'))\n",
|
81 |
+
"lstm_model.load_state_dict(torch.load(\"./lstm_weights.pth\", map_location='cpu'))\n",
|
82 |
"\n",
|
83 |
"# ========== Helper Functions Burgers ==========\n",
|
84 |
"def exacts_equals_timewindow(t_0, Re, time_window=40):\n",
|
|
|
228 |
"\n",
|
229 |
"adv_dif_model = get_adv_dif_model(3, 128)\n",
|
230 |
"adv_dif_model, _, _, _ = load_model_adv_dif(\n",
|
231 |
+
" \"./FlexiPropagator_2D_2025-01-30-12-11-01_0aee8fb0_best.pt\", \n",
|
232 |
" adv_dif_model\n",
|
233 |
")\n",
|
234 |
"\n",
|
FlexiPropagator_2025-02-01-04-31-51_431b6c0b_best.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8fcb411334194dafebe91bf2da31e74ebc8520b8d06e9ad85962240f53b00851
|
3 |
+
size 5832624
|
FlexiPropagator_2D_2025-01-30-12-11-01_0aee8fb0_best.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fff8e47d9e448b592a162699bcf49bce0622b29d49dd4303b9671c93f1e36ead
|
3 |
+
size 3873530
|
__pycache__/LSTM_model.cpython-310.pyc
CHANGED
Binary files a/__pycache__/LSTM_model.cpython-310.pyc and b/__pycache__/LSTM_model.cpython-310.pyc differ
|
|
__pycache__/config_adv_dif.cpython-310.pyc
CHANGED
Binary files a/__pycache__/config_adv_dif.cpython-310.pyc and b/__pycache__/config_adv_dif.cpython-310.pyc differ
|
|
__pycache__/config_burgers.cpython-310.pyc
CHANGED
Binary files a/__pycache__/config_burgers.cpython-310.pyc and b/__pycache__/config_burgers.cpython-310.pyc differ
|
|
__pycache__/data_adv_dif.cpython-310.pyc
CHANGED
Binary files a/__pycache__/data_adv_dif.cpython-310.pyc and b/__pycache__/data_adv_dif.cpython-310.pyc differ
|
|
__pycache__/data_burgers.cpython-310.pyc
CHANGED
Binary files a/__pycache__/data_burgers.cpython-310.pyc and b/__pycache__/data_burgers.cpython-310.pyc differ
|
|
__pycache__/model_adv_dif.cpython-310.pyc
CHANGED
Binary files a/__pycache__/model_adv_dif.cpython-310.pyc and b/__pycache__/model_adv_dif.cpython-310.pyc differ
|
|
__pycache__/model_io_adv_dif.cpython-310.pyc
CHANGED
Binary files a/__pycache__/model_io_adv_dif.cpython-310.pyc and b/__pycache__/model_io_adv_dif.cpython-310.pyc differ
|
|
__pycache__/model_io_burgers.cpython-310.pyc
CHANGED
Binary files a/__pycache__/model_io_burgers.cpython-310.pyc and b/__pycache__/model_io_burgers.cpython-310.pyc differ
|
|
__pycache__/model_v2.cpython-310.pyc
CHANGED
Binary files a/__pycache__/model_v2.cpython-310.pyc and b/__pycache__/model_v2.cpython-310.pyc differ
|
|
ae_decoder_weights.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:80cea1e62b925dc1f89ce602daa5ee1d7934fdd4d72ebe3a673fa561da5df899
|
3 |
+
size 967778
|
ae_encoder_weights.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6000b321db98575c5d2267dc01c7b4399b00d8dba2b4b23e6ec19635b258a6e4
|
3 |
+
size 967266
|
ae_model.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ac24397472f259ecc762f6fcc67b24f2fa1c9d00097bdc01f442ecdb5f8fd23b
|
3 |
+
size 1934122
|
app.ipynb
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
-
"execution_count":
|
6 |
"id": "bc0b9235-53d3-49f1-a297-e404370cd5d9",
|
7 |
"metadata": {},
|
8 |
"outputs": [
|
@@ -10,7 +10,7 @@
|
|
10 |
"name": "stdout",
|
11 |
"output_type": "stream",
|
12 |
"text": [
|
13 |
-
"* Running on local URL: http://127.0.0.1:
|
14 |
"\n",
|
15 |
"To create a public link, set `share=True` in `launch()`.\n"
|
16 |
]
|
@@ -18,7 +18,7 @@
|
|
18 |
{
|
19 |
"data": {
|
20 |
"text/html": [
|
21 |
-
"<div><iframe src=\"http://127.0.0.1:
|
22 |
],
|
23 |
"text/plain": [
|
24 |
"<IPython.core.display.HTML object>"
|
@@ -31,7 +31,7 @@
|
|
31 |
"data": {
|
32 |
"text/plain": []
|
33 |
},
|
34 |
-
"execution_count":
|
35 |
"metadata": {},
|
36 |
"output_type": "execute_result"
|
37 |
}
|
@@ -65,7 +65,7 @@
|
|
65 |
" return Model(encoder, decoder, propagator)\n",
|
66 |
"\n",
|
67 |
"flexi_prop_model = get_burgers_model(128, 2)\n",
|
68 |
-
"checkpoint = torch.load(\"
|
69 |
"flexi_prop_model.load_state_dict(checkpoint['model_state_dict'])\n",
|
70 |
"flexi_prop_model.eval()\n",
|
71 |
"\n",
|
@@ -75,10 +75,10 @@
|
|
75 |
"ae_model = AE_Model(ae_encoder, ae_decoder)\n",
|
76 |
"lstm_model = PytorchLSTM()\n",
|
77 |
"\n",
|
78 |
-
"ae_encoder.load_state_dict(torch.load(\"
|
79 |
-
"ae_decoder.load_state_dict(torch.load(\"
|
80 |
-
"ae_model.load_state_dict(torch.load(\"
|
81 |
-
"lstm_model.load_state_dict(torch.load(\"
|
82 |
"\n",
|
83 |
"# ========== Helper Functions Burgers ==========\n",
|
84 |
"def exacts_equals_timewindow(t_0, Re, time_window=40):\n",
|
@@ -228,7 +228,7 @@
|
|
228 |
"\n",
|
229 |
"adv_dif_model = get_adv_dif_model(3, 128)\n",
|
230 |
"adv_dif_model, _, _, _ = load_model_adv_dif(\n",
|
231 |
-
" \"
|
232 |
" adv_dif_model\n",
|
233 |
")\n",
|
234 |
"\n",
|
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
+
"execution_count": 1,
|
6 |
"id": "bc0b9235-53d3-49f1-a297-e404370cd5d9",
|
7 |
"metadata": {},
|
8 |
"outputs": [
|
|
|
10 |
"name": "stdout",
|
11 |
"output_type": "stream",
|
12 |
"text": [
|
13 |
+
"* Running on local URL: http://127.0.0.1:7885\n",
|
14 |
"\n",
|
15 |
"To create a public link, set `share=True` in `launch()`.\n"
|
16 |
]
|
|
|
18 |
{
|
19 |
"data": {
|
20 |
"text/html": [
|
21 |
+
"<div><iframe src=\"http://127.0.0.1:7885/\" width=\"100%\" height=\"500\" allow=\"autoplay; camera; microphone; clipboard-read; clipboard-write;\" frameborder=\"0\" allowfullscreen></iframe></div>"
|
22 |
],
|
23 |
"text/plain": [
|
24 |
"<IPython.core.display.HTML object>"
|
|
|
31 |
"data": {
|
32 |
"text/plain": []
|
33 |
},
|
34 |
+
"execution_count": 1,
|
35 |
"metadata": {},
|
36 |
"output_type": "execute_result"
|
37 |
}
|
|
|
65 |
" return Model(encoder, decoder, propagator)\n",
|
66 |
"\n",
|
67 |
"flexi_prop_model = get_burgers_model(128, 2)\n",
|
68 |
+
"checkpoint = torch.load(\"./FlexiPropagator_2025-02-01-10-28-34_3e9656b5_best.pt\", map_location='cpu')\n",
|
69 |
"flexi_prop_model.load_state_dict(checkpoint['model_state_dict'])\n",
|
70 |
"flexi_prop_model.eval()\n",
|
71 |
"\n",
|
|
|
75 |
"ae_model = AE_Model(ae_encoder, ae_decoder)\n",
|
76 |
"lstm_model = PytorchLSTM()\n",
|
77 |
"\n",
|
78 |
+
"ae_encoder.load_state_dict(torch.load(\"./ae_encoder_weights.pth\", map_location='cpu'))\n",
|
79 |
+
"ae_decoder.load_state_dict(torch.load(\"./ae_decoder_weights.pth\", map_location='cpu'))\n",
|
80 |
+
"ae_model.load_state_dict(torch.load(\"./ae_model.pth\", map_location='cpu'))\n",
|
81 |
+
"lstm_model.load_state_dict(torch.load(\"./lstm_weights.pth\", map_location='cpu'))\n",
|
82 |
"\n",
|
83 |
"# ========== Helper Functions Burgers ==========\n",
|
84 |
"def exacts_equals_timewindow(t_0, Re, time_window=40):\n",
|
|
|
228 |
"\n",
|
229 |
"adv_dif_model = get_adv_dif_model(3, 128)\n",
|
230 |
"adv_dif_model, _, _, _ = load_model_adv_dif(\n",
|
231 |
+
" \"./FlexiPropagator_2D_2025-01-30-12-11-01_0aee8fb0_best.pt\", \n",
|
232 |
" adv_dif_model\n",
|
233 |
")\n",
|
234 |
"\n",
|
app.py
CHANGED
@@ -32,7 +32,7 @@ def get_burgers_model(input_dim, latent_dim):
|
|
32 |
return Model(encoder, decoder, propagator)
|
33 |
|
34 |
flexi_prop_model = get_burgers_model(128, 2)
|
35 |
-
checkpoint = torch.load("
|
36 |
flexi_prop_model.load_state_dict(checkpoint['model_state_dict'])
|
37 |
flexi_prop_model.eval()
|
38 |
|
@@ -42,10 +42,10 @@ ae_decoder = AE_Decoder(2, 128)
|
|
42 |
ae_model = AE_Model(ae_encoder, ae_decoder)
|
43 |
lstm_model = PytorchLSTM()
|
44 |
|
45 |
-
ae_encoder.load_state_dict(torch.load("
|
46 |
-
ae_decoder.load_state_dict(torch.load("
|
47 |
-
ae_model.load_state_dict(torch.load("
|
48 |
-
lstm_model.load_state_dict(torch.load("
|
49 |
|
50 |
# ========== Helper Functions Burgers ==========
|
51 |
def exacts_equals_timewindow(t_0, Re, time_window=40):
|
@@ -195,7 +195,7 @@ def get_adv_dif_model(latent_dim, output_dim):
|
|
195 |
|
196 |
adv_dif_model = get_adv_dif_model(3, 128)
|
197 |
adv_dif_model, _, _, _ = load_model_adv_dif(
|
198 |
-
"
|
199 |
adv_dif_model
|
200 |
)
|
201 |
|
|
|
32 |
return Model(encoder, decoder, propagator)
|
33 |
|
34 |
flexi_prop_model = get_burgers_model(128, 2)
|
35 |
+
checkpoint = torch.load("./FlexiPropagator_2025-02-01-10-28-34_3e9656b5_best.pt", map_location='cpu')
|
36 |
flexi_prop_model.load_state_dict(checkpoint['model_state_dict'])
|
37 |
flexi_prop_model.eval()
|
38 |
|
|
|
42 |
ae_model = AE_Model(ae_encoder, ae_decoder)
|
43 |
lstm_model = PytorchLSTM()
|
44 |
|
45 |
+
ae_encoder.load_state_dict(torch.load("./ae_encoder_weights.pth", map_location='cpu'))
|
46 |
+
ae_decoder.load_state_dict(torch.load("./ae_decoder_weights.pth", map_location='cpu'))
|
47 |
+
ae_model.load_state_dict(torch.load("./ae_model.pth", map_location='cpu'))
|
48 |
+
lstm_model.load_state_dict(torch.load("./lstm_weights.pth", map_location='cpu'))
|
49 |
|
50 |
# ========== Helper Functions Burgers ==========
|
51 |
def exacts_equals_timewindow(t_0, Re, time_window=40):
|
|
|
195 |
|
196 |
adv_dif_model = get_adv_dif_model(3, 128)
|
197 |
adv_dif_model, _, _, _ = load_model_adv_dif(
|
198 |
+
"./FlexiPropagator_2D_2025-01-30-12-11-01_0aee8fb0_best.pt",
|
199 |
adv_dif_model
|
200 |
)
|
201 |
|
lstm_weights.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1ac2a53b313bbf10d06be4d01c5622121921cfd3b7a48e43213992e8c8b71cc6
|
3 |
+
size 85374
|