Skip to content
Snippets Groups Projects
Commit 53fc6f10 authored by Max Ramsay King's avatar Max Ramsay King
Browse files

updated react elements

parent 9db06748
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,7 @@ bp = Blueprint("progress", __name__)
def response():
# hyperparameters to change
# print("thing: ", request.files['dataset_upload'] )
if request.method == 'POST':
exclude_method = request.form.getlist("action_space")
......@@ -82,8 +82,10 @@ def response():
best_q_values = np.array(best_q_values)
# save('best_q_values_{}_{}percent_{}.npy'.format(IsLeNet, int(toy_size*100), ds), best_q_values)
#best_q_values = load('best_q_values_{}_{}percent_{}.npy'.format(IsLeNet, int(toy_size*100), ds), allow_pickle=True)
# best_q_values = load('best_q_values_{}_{}percent_{}.npy'.format(IsLeNet, int(toy_size*100), ds), allow_pickle=True)
print("DONE")
......
......@@ -3,26 +3,29 @@ import './App.css';
import React, { useState, useEffect } from "react";
import axios from "axios";
// import {BrowerRouter as Router, Route, Switch} from 'react-router-dom';
function App() {
const [formData, setFormData] = useState(null)
function getData() {
axios({
method: "POST",
url:"/profile",
})
.then((response) => {
const res =response.data
setProfileData(({
profile_name: res.name,
about_me: res.about}))
}).catch((error) => {
if (error.response) {
console.log(error.response)
console.log(error.response.status)
console.log(error.response.headers)
}
})}
// const [formData, setFormData] = useState(null)
// function getData() {
// axios({
// method: "POST",
// url:"/profile",
// })
// .then((response) => {
// const res =response.data
// setProfileData(({
// profile_name: res.name,
// about_me: res.about}))
// }).catch((error) => {
// if (error.response) {
// console.log(error.response)
// console.log(error.response.status)
// console.log(error.response.headers)
// }
// })}
//end of new line
return (
......
import React from 'react';
import React, { useState, useEffect } from "react";
import axios from "axios";
class Home extends React.Component{
constructor(props) {
super(props);
this.state = {value: 'coconut'};
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
}
handleChange(event) {
this.setState({value: event.target.value});
}
handleSubmit(event) {
alert('Your favorite flavor is: ' + this.state.value);
event.preventDefault();
}
render(){
return (
<div>
......@@ -9,6 +28,33 @@ class Home extends React.Component{
<form action="/user_input" method="POST" enctype="multipart/form-data">
<label for="dataset_upload">You can upload your dataset folder here:</label>
<input type="file" id='dataset_upload' name="dataset_upload" class="upload" /><br></br>
Or you can select a dataset from our database: <br/>
<input type="radio" id="dataset1"
name="dataset_selection" value="MNIST" />
<label for="dataset1">MNIST dataset</label><br/>
<input type="radio" id="dataset2"
name="dataset_selection" value="KMNIST" />
<label for="dataset2">KMNIST dataset</label><br />
<input type="radio" id="dataset3"
name="dataset_selection" value="FashionMNIST" />
<label for="dataset3">FashionMNIST dataset</label><br />
<input type="radio" id="dataset4"
name="dataset_selection" value="CIFAR10" />
<label for="dataset4">CIFAR10 dataset</label><br />
<input type="radio" id="dataset5"
name="dataset_selection" value="CIFAR100" />
<label for="dataset5">CIFAR100 dataset</label><br />
<input type="radio" id="dataset6"
name="dataset_selection" value="Other" />
<label for="dataset6">Other dataset DIFFERENT</label><br /><br />
<input type="submit"></input>
</form>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment