Skip to content

Commit

Permalink
Use real token and minor fixes (#929)
Browse files Browse the repository at this point in the history
Signed-off-by: bmyrcha <[email protected]>
  • Loading branch information
bmyrcha authored Jun 1, 2023
1 parent ee049c7 commit 7e4bef1
Show file tree
Hide file tree
Showing 15 changed files with 45 additions and 37 deletions.
1 change: 0 additions & 1 deletion neural_insights/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,3 @@ q_model = fit(
## Research Collaborations

Welcome to raise any interesting research ideas on model compression techniques and feel free to reach us ([email protected]). Look forward to our collaborations on Neural Insights!

2 changes: 1 addition & 1 deletion neural_insights/gui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions neural_insights/gui/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const api = axios.create({

function App() {
document.body.style = 'background: #ececec;';
localStorage.setItem('token', window.location.search.replace('?token=', ''));
return (
<div className="App">
<Diagnosis />
Expand Down
4 changes: 2 additions & 2 deletions neural_insights/gui/src/components/Graph/Graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function Graph({ setSelectedNode, selectedWorkload, selectedOp, s
path: [selectedWorkload.model_path],
...((groupNode.length || groupNodeOpList.length) && { group: [...groupNode, ...groupNodeOpList] })
};
api.post('api/model/graph?token=asd', payload)
api.post('api/model/graph?token=' + localStorage.getItem('token'), payload)
.then(
response => {
setGraph(response.data);
Expand All @@ -49,7 +49,7 @@ export default function Graph({ setSelectedNode, selectedWorkload, selectedOp, s

useEffect(() => {
if (selectedOp) {
api.post('api/model/graph/highlight_pattern?token=asd', {
api.post('api/model/graph/highlight_pattern?token=' + localStorage.getItem('token'), {
workload_id: selectedWorkload.uuid,
path: [selectedWorkload.model_path],
op_name: selectedOp,
Expand Down
2 changes: 1 addition & 1 deletion neural_insights/gui/src/components/Histogram/Histogram.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function Histogram({ selectedWorkload, selectedOp, histogramType, setWarningText
useEffect(() => {
if (selectedOp.length && histogramType.length) {
setHistogramData(null);
api.post('api/diagnosis/histogram?token=asd', { workload_id: selectedWorkload.uuid, op_name: selectedOp, type: histogramType })
api.post('api/diagnosis/histogram?token=' + localStorage.getItem('token'), { workload_id: selectedWorkload.uuid, op_name: selectedOp, type: histogramType })
.then(
response => {
setHistogramData(response.data);
Expand Down
2 changes: 1 addition & 1 deletion neural_insights/gui/src/components/OpDetails/OpDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function OpDetails({ selectedWorkload, selectedOp, setHistogramTy

useEffect(() => {
if (selectedOp?.length) {
api.post('api/diagnosis/op_details?token=asd', { workload_id: selectedWorkload.uuid, op_name: selectedOp })
api.post('api/diagnosis/op_details?token=' + localStorage.getItem('token'), { workload_id: selectedWorkload.uuid, op_name: selectedOp })
.then(
response => {
setOpDetails(response.data);
Expand Down
35 changes: 20 additions & 15 deletions neural_insights/gui/src/components/OpList/OpList.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ export default function OpList({ selectedWorkload, setSelectedOp, selectedOp, se

useEffect(() => {
if (selectedWorkload) {
api.post('api/diagnosis/op_list?token=asd', { workload_id: selectedWorkload.uuid })
setOpList([]);
api.post('api/diagnosis/op_list?token=' + localStorage.getItem('token'), { workload_id: selectedWorkload.uuid })
.then(
response => {
setOpList(response.data);
})
.catch(error => {
setWarningText(error.message + ': ' + error?.response?.data);
if (selectedWorkload?.status !== 'wip') {
setWarningText(error.message + ': ' + error?.response?.data);
}
});
}
}, [selectedWorkload, selectedOp]);
Expand All @@ -53,19 +56,21 @@ export default function OpList({ selectedWorkload, setSelectedOp, selectedOp, se

return (
<div className="overflow-table">
<Table className="rounded" hover>
<thead>
<tr>
<th className="header center">OP Name</th>
<th className="header center">MSE</th>
<th className="header center">Activation Min</th>
<th className="header center">Activation Max</th>
</tr>
</thead>
<tbody>
{tableContent}
</tbody>
</Table>
{opList.length > 0 &&
<Table className="rounded" hover>
<thead>
<tr>
<th className="header center">OP Name</th>
<th className="header center">MSE</th>
<th className="header center">Activation Min</th>
<th className="header center">Activation Max</th>
</tr>
</thead>
<tbody>
{tableContent}
</tbody>
</Table>
}
</div>
);
}
2 changes: 1 addition & 1 deletion neural_insights/gui/src/components/Profiling/Profiling.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function ProfilingTable({ selectedWorkload, profilingTable, setProfilingTable, s

useEffect(() => {
if (selectedWorkload) {
api.post('api/profiling?token=asd', { workload_id: selectedWorkload.uuid })
api.post('api/profiling?token=' + localStorage.getItem('token'), { workload_id: selectedWorkload.uuid })
.then(
response => {
setProfilingTable(response.data);
Expand Down
12 changes: 7 additions & 5 deletions neural_insights/gui/src/components/Workloads/Workloads.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,20 @@ export default function Workloads({ setSelectedWorkload, selectedWorkload, setWa

let socket = io('/');
socket.on('Config update', data => {
getWorkloads();
getWorkloads(false);
});

useEffect(() => {
getWorkloads();
getWorkloads(true);
}, []);

let getWorkloads = () => {
api.get('api/workloads?token=asd')
let getWorkloads = (changeSelectedWorkload) => {
api.get('api/workloads?token=' + localStorage.getItem('token'))
.then(
response => {
setSelectedWorkload(response.data.workloads[0]);
if (changeSelectedWorkload) {
setSelectedWorkload(response.data.workloads[0]);
}
setWorkloads(response.data.workloads);
setSpinner(false);
}
Expand Down
6 changes: 3 additions & 3 deletions neural_insights/web/app/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"files": {
"main.css": "/static/css/main.570a647a.css",
"main.js": "/static/js/main.f6ad24e2.js",
"main.js": "/static/js/main.38959c1a.js",
"static/js/787.c1112931.chunk.js": "/static/js/787.c1112931.chunk.js",
"static/media/IntelClear_Rg.ttf": "/static/media/IntelClear_Rg.33af11200cffaf9540ff.ttf",
"static/media/IntelClear_Lt.ttf": "/static/media/IntelClear_Lt.c5e18e9d5505364da760.ttf",
Expand All @@ -11,11 +11,11 @@
"static/media/intelone-display-regular.ttf": "/static/media/intelone-display-regular.0f8c3ef25c545acb6b7c.ttf",
"index.html": "/index.html",
"main.570a647a.css.map": "/static/css/main.570a647a.css.map",
"main.f6ad24e2.js.map": "/static/js/main.f6ad24e2.js.map",
"main.38959c1a.js.map": "/static/js/main.38959c1a.js.map",
"787.c1112931.chunk.js.map": "/static/js/787.c1112931.chunk.js.map"
},
"entrypoints": [
"static/css/main.570a647a.css",
"static/js/main.f6ad24e2.js"
"static/js/main.38959c1a.js"
]
}
2 changes: 1 addition & 1 deletion neural_insights/web/app/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><title>Intel Neural Insights</title><script defer="defer" src="/static/js/main.f6ad24e2.js"></script><link href="/static/css/main.570a647a.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><title>Neural Insights</title><script defer="defer" src="/static/js/main.38959c1a.js"></script><link href="/static/css/main.570a647a.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions neural_insights/web/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@
import argparse
import logging
import os
import secrets
import socket
import sys
from typing import Dict

from neural_compressor.utils.utility import singleton
from numpy.random import randint

from neural_compressor.utils.utility import singleton
from neural_insights.utils.consts import WORKDIR_LOCATION
from neural_insights.utils.exceptions import NotFoundException
from neural_insights.utils.logger import log
Expand Down Expand Up @@ -65,7 +66,7 @@ def determine_values_from_environment(self) -> None:
self.url_prefix = self.determine_url_prefix(args)
self.gui_port = self.determine_gui_port(args)
self.log_level = self.determine_log_level(args)
self.token = "asd" # secrets.token_hex(16)
self.token = secrets.token_hex(16)
self.allow_insecure_connections = args.get("allow_insecure_connections", False)
self.tls_certificate = args.get("cert", "")
self.tls_key = args.get("key", "")
Expand Down

0 comments on commit 7e4bef1

Please sign in to comment.