Skip to content

Commit edb6dfb

Browse files
committed
fix prettier
1 parent 5c2a19a commit edb6dfb

39 files changed

+529
-356
lines changed

src/renderer/components/Computer.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ function StatRow({ title, value }) {
6565
);
6666
}
6767

68-
6968
export default function Computer() {
7069
const [searchText, setSearchText] = useState('');
7170

src/renderer/components/Data/NewDatasetModal.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,13 @@ export default function DatasetDetailsModal({ open, setOpen }) {
4747
if (data.status === 'error') {
4848
alert(data.message);
4949
} else {
50-
await authenticatedFetch(chatAPI.Endpoints.Dataset.FileUpload(newDatasetName), {
51-
method: 'POST',
52-
body: formData,
53-
});
50+
await authenticatedFetch(
51+
chatAPI.Endpoints.Dataset.FileUpload(newDatasetName),
52+
{
53+
method: 'POST',
54+
body: formData,
55+
},
56+
);
5457
}
5558
setUploading(false);
5659
handleClose();

src/renderer/components/Experiment/DynamicPluginForm.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,6 @@ const widgets: RegistryWidgetsType = {
556556
GEvalTasksWidget,
557557
};
558558

559-
560559
export default function DynamicPluginForm({
561560
experimentInfo,
562561
plugin,

src/renderer/components/Experiment/Eval/EvalJobsTable.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,9 @@ const EvalJobsTable = () => {
248248
const jobIdsParam = selected.join(',');
249249
const compareEvalsUrl =
250250
chatAPI.Endpoints.Charts.CompareEvals(jobIdsParam);
251-
const response = await chatAPI.authenticatedFetch(compareEvalsUrl, { method: 'GET' });
251+
const response = await chatAPI.authenticatedFetch(compareEvalsUrl, {
252+
method: 'GET',
253+
});
252254
if (!response.ok) {
253255
throw new Error('Network response was not ok');
254256
}

src/renderer/components/Experiment/Eval/EvalModal.tsx

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,17 @@ async function updateTask(
5757
config,
5858
outputs,
5959
};
60-
const response = await chatAPI.authenticatedFetch(chatAPI.Endpoints.Tasks.UpdateTask(task_id), {
61-
method: 'PUT',
62-
headers: {
63-
'Content-Type': 'application/json',
64-
accept: 'application/json',
60+
const response = await chatAPI.authenticatedFetch(
61+
chatAPI.Endpoints.Tasks.UpdateTask(task_id),
62+
{
63+
method: 'PUT',
64+
headers: {
65+
'Content-Type': 'application/json',
66+
accept: 'application/json',
67+
},
68+
body: JSON.stringify(configBody),
6569
},
66-
body: JSON.stringify(configBody),
67-
});
70+
);
6871
const result = await response.json();
6972
return result;
7073
}
@@ -86,14 +89,17 @@ async function createNewTask(
8689
outputs,
8790
type: 'EVAL',
8891
};
89-
const response = await chatAPI.authenticatedFetch(chatAPI.Endpoints.Tasks.NewTask(), {
90-
method: 'PUT',
91-
headers: {
92-
'Content-Type': 'application/json',
93-
accept: 'application/json',
92+
const response = await chatAPI.authenticatedFetch(
93+
chatAPI.Endpoints.Tasks.NewTask(),
94+
{
95+
method: 'PUT',
96+
headers: {
97+
'Content-Type': 'application/json',
98+
accept: 'application/json',
99+
},
100+
body: JSON.stringify(configBody),
94101
},
95-
body: JSON.stringify(configBody),
96-
});
102+
);
97103
const result = await response.json();
98104
return result;
99105
}

src/renderer/components/Experiment/ExperimentNotes.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ function setTheme(editor: any, monaco: any) {
2727
monaco.editor.setTheme('my-theme');
2828
}
2929

30-
3130
export default function ExperimentNotes({}) {
3231
const editorRef = useRef(null);
3332
const [isEditing, setIsEditing] = useState(false);

src/renderer/components/Experiment/Export/ExportModal.tsx

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,17 @@ async function updateTask(
124124
config,
125125
outputs,
126126
};
127-
const response = await chatAPI.authenticatedFetch(chatAPI.Endpoints.Tasks.UpdateTask(taskId), {
128-
method: 'PUT',
129-
headers: {
130-
'Content-Type': 'application/json',
131-
accept: 'application/json',
127+
const response = await chatAPI.authenticatedFetch(
128+
chatAPI.Endpoints.Tasks.UpdateTask(taskId),
129+
{
130+
method: 'PUT',
131+
headers: {
132+
'Content-Type': 'application/json',
133+
accept: 'application/json',
134+
},
135+
body: JSON.stringify(configBody),
132136
},
133-
body: JSON.stringify(configBody),
134-
});
137+
);
135138
const result = await response.json();
136139
return result;
137140
}
@@ -153,14 +156,17 @@ async function createNewTask(
153156
outputs,
154157
type: 'EXPORT',
155158
};
156-
const response = await chatAPI.authenticatedFetch(chatAPI.Endpoints.Tasks.NewTask(), {
157-
method: 'PUT',
158-
headers: {
159-
'Content-Type': 'application/json',
160-
accept: 'application/json',
159+
const response = await chatAPI.authenticatedFetch(
160+
chatAPI.Endpoints.Tasks.NewTask(),
161+
{
162+
method: 'PUT',
163+
headers: {
164+
'Content-Type': 'application/json',
165+
accept: 'application/json',
166+
},
167+
body: JSON.stringify(configBody),
161168
},
162-
body: JSON.stringify(configBody),
163-
});
169+
);
164170
const result = await response.json();
165171
return result;
166172
}

src/renderer/components/Experiment/Foundation/CurrentFoundationInfo.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ import {
2929
} from 'lucide-react';
3030
import useSWR from 'swr';
3131
import * as chatAPI from '../../../lib/transformerlab-api-sdk';
32-
import { getAPIFullPath, fetcher, authenticatedFetch } from 'renderer/lib/transformerlab-api-sdk';
32+
import {
33+
getAPIFullPath,
34+
fetcher,
35+
authenticatedFetch,
36+
} from 'renderer/lib/transformerlab-api-sdk';
3337
import ModelDetails from './ModelDetails';
3438
import DownloadProgressBox from '../../Shared/DownloadProgressBox';
3539
import ModelProvenanceTimeline from './ModelProvenanceTimeline';
@@ -45,7 +49,6 @@ const fetchWithPost = ({ url, post }) =>
4549
body: post,
4650
}).then((res) => res.json());
4751

48-
4952
function modelNameIsInHuggingfaceFormat(modelName: string) {
5053
return modelName.includes('/');
5154
}
@@ -302,12 +305,16 @@ export default function CurrentFoundationInfo({
302305

303306
useMemo(() => {
304307
if (experimentInfo?.config?.foundation_filename) {
305-
authenticatedFetch(chatAPI.Endpoints.Models.ModelDetailsFromFilesystem(huggingfaceId))
308+
authenticatedFetch(
309+
chatAPI.Endpoints.Models.ModelDetailsFromFilesystem(huggingfaceId),
310+
)
306311
.then((res) => res.json())
307312
.catch((error) => console.log(error));
308313
setHugggingfaceData({});
309314
} else if (huggingfaceId && modelNameIsInHuggingfaceFormat(huggingfaceId)) {
310-
authenticatedFetch(chatAPI.Endpoints.Models.GetLocalHFConfig(huggingfaceId))
315+
authenticatedFetch(
316+
chatAPI.Endpoints.Models.GetLocalHFConfig(huggingfaceId),
317+
)
311318
.then((res) => res.json())
312319
.then((data) => setHugggingfaceData(data))
313320
.catch((error) => console.log(error));

src/renderer/components/Experiment/Foundation/ModelDetails.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ function modelNameIsInHuggingfaceFormat(modelName: string) {
4141
return modelName.includes('/');
4242
}
4343

44-
4544
export default function ModelDetails({
4645
experimentInfo,
4746
adaptor,

src/renderer/components/Experiment/Foundation/RunModelButton.tsx

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ export default function RunModelButton({
9191
Array.isArray(row.supports) &&
9292
row.supports.some(
9393
// Some models list as text-to-speech, others as text-to-audio
94-
(support: string) => (support.toLowerCase() === 'text-to-speech' || pipelineTag === 'text-to-audio'),
94+
(support: string) =>
95+
support.toLowerCase() === 'text-to-speech' ||
96+
pipelineTag === 'text-to-audio',
9597
);
9698

9799
// For text-to-speech models: must also have text-to-speech support
@@ -136,7 +138,7 @@ export default function RunModelButton({
136138
'model_architectures:' +
137139
experimentInfo?.config?.foundation_model_architecture, //filter
138140
),
139-
{}
141+
{},
140142
);
141143
const inferenceEnginesJSON = await inferenceEngines.json();
142144
const experimentId = experimentInfo?.id;
@@ -153,7 +155,7 @@ export default function RunModelButton({
153155
inferenceEngineFriendlyName: inferenceEngineFriendlyName || null,
154156
}),
155157
),
156-
{}
158+
{},
157159
);
158160

159161
return {
@@ -194,17 +196,19 @@ export default function RunModelButton({
194196

195197
// Update the experiment config with the first supported engine
196198
if (experimentInfo?.id) {
197-
chatAPI.authenticatedFetch(
198-
chatAPI.Endpoints.Experiment.UpdateConfig(
199-
experimentInfo.id,
200-
'inferenceParams',
201-
JSON.stringify(newInferenceSettings),
202-
),
203-
).catch(() => {
204-
console.error(
205-
'Failed to update inferenceParams in experiment config',
206-
);
207-
});
199+
chatAPI
200+
.authenticatedFetch(
201+
chatAPI.Endpoints.Experiment.UpdateConfig(
202+
experimentInfo.id,
203+
'inferenceParams',
204+
JSON.stringify(newInferenceSettings),
205+
),
206+
)
207+
.catch(() => {
208+
console.error(
209+
'Failed to update inferenceParams in experiment config',
210+
);
211+
});
208212
}
209213
} else {
210214
// This preserves the older logic where we try to get the default inference engine for a blank experiment

0 commit comments

Comments
 (0)