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
0cb7c53d
Commit
0cb7c53d
authored
1 month ago
by
sanjaycal
Browse files
Options
Downloads
Patches
Plain Diff
add eval templates
parent
1ee8db1f
Branches
Branches containing commit
Tags
Tags containing commit
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
+30
-8
30 additions, 8 deletions
...renderer/components/Experiment/Workflows/NewNodeModal.tsx
src/renderer/components/Experiment/Workflows/index.tsx
+1
-0
1 addition, 0 deletions
src/renderer/components/Experiment/Workflows/index.tsx
with
31 additions
and
8 deletions
src/renderer/components/Experiment/Workflows/NewNodeModal.tsx
+
30
−
8
View file @
0cb7c53d
...
...
@@ -22,7 +22,12 @@ import { node } from 'webpack';
const
fetcher
=
(
url
:
any
)
=>
fetch
(
url
).
then
((
res
)
=>
res
.
json
());
export
default
function
NewNodeModal
({
open
,
onClose
,
selectedWorkflow
})
{
export
default
function
NewNodeModal
({
open
,
onClose
,
selectedWorkflow
,
experimentInfo
,
})
{
const
[
mode
,
setMode
]
=
useState
(
'
OTHER
'
);
console
.
log
(
mode
);
...
...
@@ -33,13 +38,7 @@ export default function NewNodeModal({ open, onClose, selectedWorkflow }) {
isLoading
:
isLoading
,
}
=
useSWR
(
chatAPI
.
GET_TRAINING_TEMPLATE_URL
(),
fetcher
);
const
{
data
:
workflowsData
,
error
:
workflowsError
,
isLoading
:
workflowsIsLoading
,
}
=
useSWR
(
chatAPI
.
Endpoints
.
Workflows
.
List
(),
fetcher
);
console
.
log
(
trainingTemplatesData
);
const
evaluationData
=
JSON
.
parse
(
experimentInfo
?.
config
?.
evaluations
);
const
handleModeChange
=
(
event
:
React
.
ChangeEvent
<
HTMLSelectElement
>
)
=>
{
setMode
(
event
.
target
.
outerText
);
...
...
@@ -72,6 +71,22 @@ export default function NewNodeModal({ open, onClose, selectedWorkflow }) {
JSON
.
stringify
(
node
)
)
);
}
else
if
(
mode
==
'
EVAL
'
)
{
const
template
=
formData
.
get
(
'
evalTemplate
'
)
as
string
;
const
config
=
JSON
.
parse
(
selectedWorkflow
.
config
);
console
.
log
(
config
);
const
node
=
{
name
:
name
,
type
:
'
EVAL
'
,
out
:
(
config
.
nodes
.
length
+
1
).
toString
(),
template
:
template
,
};
await
fetch
(
chatAPI
.
Endpoints
.
Workflows
.
AddNode
(
selectedWorkflow
.
id
,
JSON
.
stringify
(
node
)
)
);
}
else
{
const
node
=
JSON
.
parse
(
formData
.
get
(
'
node
'
)
as
string
);
node
.
name
=
name
;
...
...
@@ -94,6 +109,7 @@ export default function NewNodeModal({ open, onClose, selectedWorkflow }) {
>
<
Option
value
=
"OTHER"
>
OTHER
</
Option
>
<
Option
value
=
"TRAIN"
>
TRAIN
</
Option
>
<
Option
value
=
"EVAL"
>
EVAL
</
Option
>
</
Select
>
<
FormLabel
>
Name
</
FormLabel
>
<
Textarea
minRows
=
{
4
}
autoFocus
required
name
=
"name"
/>
...
...
@@ -103,6 +119,12 @@ export default function NewNodeModal({ open, onClose, selectedWorkflow }) {
<
Option
value
=
{
template
[
1
]
}
>
{
template
[
1
]
}
</
Option
>
))
}
</
Select
>
)
:
mode
==
'
EVAL
'
?
(
<
Select
name
=
"evalTemplate"
>
{
evaluationData
.
map
((
template
)
=>
(
<
Option
value
=
{
template
.
name
}
>
{
template
.
name
}
</
Option
>
))
}
</
Select
>
)
:
(
<
FormControl
>
<
FormLabel
>
Nodes
</
FormLabel
>
...
...
This diff is collapsed.
Click to expand it.
src/renderer/components/Experiment/Workflows/index.tsx
+
1
−
0
View file @
0cb7c53d
...
...
@@ -75,6 +75,7 @@ export default function Workflows({ experimentInfo }) {
mutateWorkflows
();
}
}
selectedWorkflow
=
{
selectedWorkflow
}
experimentInfo
=
{
experimentInfo
}
/>
)
}
<
Typography
level
=
"h1"
>
Workflows
</
Typography
>
...
...
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