Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Transformerlab App
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
TransformerLab
Transformerlab App
Commits
4d2ae388
Commit
4d2ae388
authored
3 weeks ago
by
sanjaycal
Browse files
Options
Downloads
Patches
Plain Diff
Made frontend work with new api with id and metadata
parent
58547525
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/renderer/components/Experiment/Workflows/NewNodeModal.tsx
+0
-2
0 additions, 2 deletions
...renderer/components/Experiment/Workflows/NewNodeModal.tsx
src/renderer/components/Experiment/Workflows/WorkflowCanvas.tsx
+36
-13
36 additions, 13 deletions
...nderer/components/Experiment/Workflows/WorkflowCanvas.tsx
with
36 additions
and
15 deletions
src/renderer/components/Experiment/Workflows/NewNodeModal.tsx
+
0
−
2
View file @
4d2ae388
...
...
@@ -62,7 +62,6 @@ export default function NewNodeModal({
const
node
=
{
name
:
name
,
type
:
'
TRAIN
'
,
out
:
(
config
.
nodes
.
length
+
1
).
toString
(),
template
:
template
,
};
await
fetch
(
...
...
@@ -78,7 +77,6 @@ export default function NewNodeModal({
const
node
=
{
name
:
name
,
type
:
'
EVAL
'
,
out
:
(
config
.
nodes
.
length
+
1
).
toString
(),
template
:
template
,
};
await
fetch
(
...
...
This diff is collapsed.
Click to expand it.
src/renderer/components/Experiment/Workflows/WorkflowCanvas.tsx
+
36
−
13
View file @
4d2ae388
...
...
@@ -14,18 +14,30 @@ import CustomNode from './CustomNode';
const
nodeTypes
=
{
customNode
:
CustomNode
};
function
generateNodes
(
workflow
:
any
)
{
const
workflowConfig
=
JSON
.
parse
(
workflow
?.
config
);
if
(
workflowConfig
.
nodes
.
length
==
0
)
{
return
[];
}
let
out
:
any
[]
=
[];
let
currentTask
=
'
0
'
;
let
currentTask
=
workflowConfig
.
nodes
[
0
].
id
;
let
position
=
0
;
const
workflowConfig
=
JSON
.
parse
(
workflow
?.
config
);
console
.
log
(
workflowConfig
);
while
(
currentTask
<
workflowConfig
.
nodes
.
length
)
{
while
(
currentTask
!=
'
END
'
)
{
let
currentNode
=
{};
workflowConfig
.
nodes
.
forEach
((
node
)
=>
{
if
(
node
.
id
==
currentTask
)
{
currentNode
=
node
;
}
});
const
data
=
{
label
:
workflowConfig
.
nodes
[
current
Task
]
.
name
,
jobType
:
workflowConfig
.
nodes
[
current
Task
]
.
type
,
template
:
workflowConfig
.
nodes
[
current
Task
]
.
template
,
label
:
current
Node
.
name
,
jobType
:
current
Node
.
type
,
template
:
current
Node
.
template
,
};
const
nextNode
=
{
id
:
currentTask
,
...
...
@@ -35,31 +47,42 @@ function generateNodes(workflow: any) {
};
out
.
push
(
nextNode
);
position
+=
120
;
currentTask
=
workflowConfig
.
nodes
[
current
Task
]
.
out
;
currentTask
=
current
Node
.
out
;
}
return
out
;
}
function
generateEdges
(
workflow
:
any
)
{
const
workflowConfig
=
JSON
.
parse
(
workflow
?.
config
);
if
(
workflowConfig
.
nodes
.
length
<=
1
)
{
return
[];
}
let
out
:
any
[]
=
[];
let
currentTask
=
'
0
'
;
let
ids
=
'
0
'
;
let
currentTask
=
workflowConfig
.
nodes
[
0
].
id
;
let
ids
=
workflowConfig
.
nodes
[
0
].
id
;
const
workflowConfig
=
JSON
.
parse
(
workflow
?.
config
);
console
.
log
(
workflowConfig
);
while
(
currentTask
<
workflowConfig
.
nodes
.
length
)
{
while
(
currentTask
!=
'
END
'
)
{
let
currentNode
=
{};
workflowConfig
.
nodes
.
forEach
((
node
)
=>
{
if
(
node
.
id
==
currentTask
)
{
currentNode
=
node
;
}
});
out
.
push
({
id
:
ids
,
source
:
currentTask
,
target
:
workflowConfig
.
nodes
[
current
Task
]
.
out
,
target
:
current
Node
.
out
,
markerEnd
:
{
type
:
'
arrow
'
,
},
});
ids
+=
1
;
currentTask
=
workflowConfig
.
nodes
[
current
Task
]
.
out
;
currentTask
=
current
Node
.
out
;
}
return
out
;
...
...
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