def teacher_details(): # init a basic bar chart: # http://bokeh.pydata.org/en/latest/docs/user_guide/plotting.html#bars # grab the static resources js_resources = INLINE.render_js() css_resources = INLINE.render_css() # render template script, div1 = plotdata() script2, div2 = plotdata2() html = render_template('teacher_details.html', script=script, div1=div1, script2=script2, div2=div2, js_resources=js_resources, css_resources=css_resources, ) return encode_utf8(html)
help='eval batch size') parser.add_argument('--seed', type=int, default=1234, help='set random seed') parser.add_argument('--cuda', action='store_true', help='use CUDA device') parser.add_argument('--gpu_id', type=int, help='GPU device id used') args = parser.parse_args() if args.model_type == 'baseline': # data preprocess and prepare data_path = './data/dev.txt' split_ratio = 0.3 preprocess(data_path, split_ratio) # dataset load and plot train_dataset = EmojiDataset('./data/Xtrain.npy', './data/ytrain.npy') plotdata(np.load('./data/Xtrain.npy', allow_pickle=True), np.load('./data/ytrain.npy', allow_pickle=True)) test_dataset = EmojiDataset('./data/Xtest.npy', './data/ytest.npy') train_dataloader = DataLoader(train_dataset, batch_size=args.train_batch_size, shuffle=False, collate_fn=collate_fn) test_dataloader = DataLoader(test_dataset, batch_size=args.eval_batch_size, shuffle=False, collate_fn=collate_fn) torch.manual_seed(args.seed) # model prepare use_gpu = False
def graph(): # graph 그리는 부분 from data import plotdata script, div = plotdata() return render_template('graph.html',script=script, div=div)