Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MetaRL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Wang, Mia
MetaRL
Commits
53cedb63
Commit
53cedb63
authored
2 years ago
by
Mia Wang
Browse files
Options
Downloads
Patches
Plain Diff
linked home to confirm page && request the data from server
parent
e4ff0194
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
backend_react/react_app.py
+6
-6
6 additions, 6 deletions
backend_react/react_app.py
src/pages/Confirm.js
+13
-8
13 additions, 8 deletions
src/pages/Confirm.js
src/pages/Home.js
+1
-0
1 addition, 0 deletions
src/pages/Home.js
with
20 additions
and
14 deletions
backend_react/react_app.py
+
6
−
6
View file @
53cedb63
...
...
@@ -23,9 +23,9 @@ import os
import
sys
sys
.
path
.
insert
(
0
,
os
.
path
.
abspath
(
'
..
'
))
# import agents and its functions
from
..
MetaAugment
import
UCB1_JC_py
as
UCB1_JC
from
..
MetaAugment.autoaugment_learners
import
evo_learner
#
# import agents and its functions
from
MetaAugment
import
UCB1_JC_py
as
UCB1_JC
from
MetaAugment.autoaugment_learners
import
evo_learner
import
MetaAugment.controller_networks
as
cn
import
MetaAugment.autoaugment_learners
as
aal
print
(
'
@@@ import successful
'
)
...
...
@@ -43,8 +43,8 @@ app = Flask(__name__)
def
get_form_data
():
print
(
'
@@@ in Flask Home
'
)
# form_data = request.get_json()
form_data
=
request
.
files
[
'
ds_upload
'
]
print
(
'
@@@ form_data
'
,
form_data
)
#
form_data = request.files['ds_upload']
#
print('@@@ form_data', form_data)
# form_data = request.form.get('test')
# print('@@@ this is form data', request.get_data())
...
...
@@ -156,7 +156,7 @@ def confirm():
data
=
{
'
ds
'
:
ds
,
'
ds_name
'
:
ds_name
,
'
IsLeNet
'
:
IsLeNet
,
'
ds_folder.filename
'
:
ds_name
,
'
auto_aug_learner
'
:
auto_aug_learner
,
'
batch_size
'
:
batch_size
,
'
learning_rate
'
:
learning_rate
,
'
toy_size
'
:
toy_size
,
'
iterations
'
:
iterations
,
}
return
{
'
d
at
a 1
'
:
'
show data
'
}
return
{
'
b
at
ch_size
'
:
'
12
'
}
# ========================================================================
@app.route
(
'
/training
'
,
methods
=
[
'
POST
'
,
'
GET
'
])
...
...
This diff is collapsed.
Click to expand it.
src/pages/Confirm.js
+
13
−
8
View file @
53cedb63
...
...
@@ -4,14 +4,19 @@ import CheckCircleOutlineRoundedIcon from '@mui/icons-material/CheckCircleOutlin
import
TuneRoundedIcon
from
'
@mui/icons-material/TuneRounded
'
;
export
default
function
Confirm
()
{
const
[
batchSize
,
setBatchSize
]
=
useState
(
0
)
// // const [myData, setMyData] = useState([{}])
// useEffect(async () => {
// await fetch('/confirm').then(
// response => {console.log('response', response, 'response.json()', response.json()); response.json()}
// )
// // .then(data => {console.log('training', data);
// // })
// }, []);
useEffect
(()
=>
{
const
res
=
fetch
(
'
/confirm
'
).
then
(
response
=>
response
.
json
()
).
then
(
data
=>
setBatchSize
(
data
.
batch_size
));
console
.
log
(
"
batchsize
"
,
batchSize
)
// setBatchSize(res.batch_size)
// .then(data => {console.log('training', data);
// })
},
[]);
...
...
@@ -34,7 +39,7 @@ export default function Confirm() {
<
ListItemAvatar
>
<
TuneRoundedIcon
color
=
"
primary
"
fontSize
=
'
large
'
/>
<
/ListItemAvatar
>
<
ListItemText
primary
=
"
Batch size
"
secondary
=
"
[B
atch
s
ize
]
"
/>
<
ListItemText
primary
=
"
Batch size
"
secondary
=
{
b
atch
S
ize
}
/
>
<
/ListItem
>
<
/Grid
>
<
Grid
xs
=
{
12
}
sm
=
{
6
}
item
>
...
...
This diff is collapsed.
Click to expand it.
src/pages/Home.js
+
1
−
0
View file @
53cedb63
...
...
@@ -58,6 +58,7 @@ export default function Home() {
body
:
formData
}).
then
((
response
)
=>
response
.
json
());
console
.
log
(
'
check if it is here
'
)
navigate
(
'
/confirm
'
,
{
replace
:
true
});
//
///////// testing
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment