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
500a8c13
Commit
500a8c13
authored
3 weeks ago
by
deep1401
Browse files
Options
Downloads
Patches
Plain Diff
Remove function from api file and make it a url and move logic to the component
parent
deef7232
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/Eval/EvalJobsTable.tsx
+12
-6
12 additions, 6 deletions
src/renderer/components/Experiment/Eval/EvalJobsTable.tsx
src/renderer/lib/transformerlab-api-sdk.ts
+5
-16
5 additions, 16 deletions
src/renderer/lib/transformerlab-api-sdk.ts
with
17 additions
and
22 deletions
src/renderer/components/Experiment/Eval/EvalJobsTable.tsx
+
12
−
6
View file @
500a8c13
...
@@ -121,10 +121,16 @@ const EvalJobsTable = () => {
...
@@ -121,10 +121,16 @@ const EvalJobsTable = () => {
fallbackData
:
[],
fallbackData
:
[],
});
});
// New function to call CombinedReports via SDK and send data to ViewPlotModal
const
handleCombinedReports
=
async
()
=>
{
const
handleCombinedReports
=
async
()
=>
{
try
{
try
{
const
data
=
await
chatAPI
.
COMPARE_EVALS
(
selected
);
const
jobIdsParam
=
selected
.
join
(
'
,
'
);
const
compareEvalsUrl
=
chatAPI
.
Endpoints
.
Charts
.
CompareEvals
(
jobIdsParam
);
const
response
=
await
fetch
(
compareEvalsUrl
,
{
method
:
'
GET
'
});
if
(
!
response
.
ok
)
{
throw
new
Error
(
'
Network response was not ok
'
);
}
const
data
=
await
response
.
json
();
console
.
log
(
'
data
'
,
data
);
setCurrentData
(
JSON
.
stringify
(
data
));
setCurrentData
(
JSON
.
stringify
(
data
));
setOpenPlotModal
(
true
);
setOpenPlotModal
(
true
);
setChart
(
false
);
setChart
(
false
);
...
@@ -187,10 +193,10 @@ const EvalJobsTable = () => {
...
@@ -187,10 +193,10 @@ const EvalJobsTable = () => {
level
=
"body-sm"
level
=
"body-sm"
startDecorator
=
{
<
ChartColumnIncreasingIcon
size
=
"20px"
/>
}
startDecorator
=
{
<
ChartColumnIncreasingIcon
size
=
"20px"
/>
}
// Uncomment this line to enable the combined reports feature
// Uncomment this line to enable the combined reports feature
//
onClick={handleCombinedReports}
onClick
=
{
handleCombinedReports
}
onClick
=
{
()
=>
{
//
onClick={() => {
alert
(
'
this feature coming soon
'
);
//
alert('this feature coming soon');
}
}
//
}}
sx
=
{
{
cursor
:
'
pointer
'
}
}
sx
=
{
{
cursor
:
'
pointer
'
}
}
>
>
<>
Compare Selected Evals
</>
<>
Compare Selected Evals
</>
...
...
This diff is collapsed.
Click to expand it.
src/renderer/lib/transformerlab-api-sdk.ts
+
5
−
16
View file @
500a8c13
...
@@ -1196,6 +1196,11 @@ Endpoints.ServerInfo = {
...
@@ -1196,6 +1196,11 @@ Endpoints.ServerInfo = {
StreamLog
:
()
=>
API_URL
()
+
'
server/stream_log
'
,
StreamLog
:
()
=>
API_URL
()
+
'
server/stream_log
'
,
};
};
Endpoints
.
Charts
=
{
CompareEvals
:
(
jobIds
:
string
)
=>
API_URL
()
+
'
evals/compare_evals?job_list=
'
+
jobIds
,
}
export
function
GET_TRAINING_TEMPLATE_URL
()
{
export
function
GET_TRAINING_TEMPLATE_URL
()
{
return
API_URL
()
+
'
train/templates
'
;
return
API_URL
()
+
'
train/templates
'
;
}
}
...
@@ -1551,22 +1556,6 @@ export async function EXPERIMENT_EDIT_EVALUATION(
...
@@ -1551,22 +1556,6 @@ export async function EXPERIMENT_EDIT_EVALUATION(
return
result
;
return
result
;
}
}
export
async
function
COMPARE_EVALS
(
jobIds
:
string
[])
{
const
jobIdsParam
=
jobIds
.
join
(
'
,
'
);
const
url
=
API_URL
()
+
'
evals/compare_evals?job_list=
'
+
jobIdsParam
;
console
.
log
(
'
url
'
,
url
);
console
.
log
(
'
jobIds
'
,
jobIds
);
const
response
=
await
fetch
(
url
,
{
method
:
'
GET
'
});
if
(
!
response
.
ok
)
{
throw
new
Error
(
'
Network response was not ok
'
);
}
const
data
=
await
response
.
json
();
console
.
log
(
'
data
'
,
data
);
return
data
;
}
export
async
function
EXPERIMENT_ADD_GENERATION
(
export
async
function
EXPERIMENT_ADD_GENERATION
(
id
:
string
,
id
:
string
,
name
:
string
,
name
:
string
,
...
...
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