Spaces:
Sleeping
Sleeping
Update frontend/src/components/AddModelForm.tsx
Browse files
frontend/src/components/AddModelForm.tsx
CHANGED
@@ -3,31 +3,29 @@ import React, { FC } from 'react';
|
|
3 |
interface Props {
|
4 |
newModelName: string;
|
5 |
isEvaluating: boolean;
|
6 |
-
onNameChange: (
|
7 |
onEvaluate: () => void;
|
8 |
}
|
9 |
|
10 |
const AddModelForm: FC<Props> = ({ newModelName, isEvaluating, onNameChange, onEvaluate }) => (
|
11 |
<div className="bg-white rounded-xl shadow-lg p-6">
|
12 |
-
<
|
13 |
-
<
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
</button>
|
30 |
-
</div>
|
31 |
</div>
|
32 |
);
|
33 |
|
|
|
3 |
interface Props {
|
4 |
newModelName: string;
|
5 |
isEvaluating: boolean;
|
6 |
+
onNameChange: (name: string) => void;
|
7 |
onEvaluate: () => void;
|
8 |
}
|
9 |
|
10 |
const AddModelForm: FC<Props> = ({ newModelName, isEvaluating, onNameChange, onEvaluate }) => (
|
11 |
<div className="bg-white rounded-xl shadow-lg p-6">
|
12 |
+
<h3 className="text-xl font-bold mb-4">Evaluate a New Model</h3>
|
13 |
+
<input
|
14 |
+
type="text"
|
15 |
+
value={newModelName}
|
16 |
+
onChange={e => onNameChange(e.target.value)}
|
17 |
+
placeholder="Enter model name (e.g., bert-base-uncased)"
|
18 |
+
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500 mb-4"
|
19 |
+
/>
|
20 |
+
<button
|
21 |
+
onClick={onEvaluate}
|
22 |
+
disabled={isEvaluating}
|
23 |
+
className={`px-4 py-2 rounded-lg font-medium text-white ${
|
24 |
+
isEvaluating ? 'bg-gray-400 cursor-not-allowed' : 'bg-indigo-600 hover:bg-indigo-700'
|
25 |
+
}`}
|
26 |
+
>
|
27 |
+
{isEvaluating ? 'Evaluating...' : 'Evaluate Model'}
|
28 |
+
</button>
|
|
|
|
|
29 |
</div>
|
30 |
);
|
31 |
|