yigagilbert commited on
Commit
274aeef
·
verified ·
1 Parent(s): 627ee08

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: (value: 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
- <h2 className="text-2xl font-bold text-gray-800 mb-6">Add a New Model</h2>
13
- <div className="space-y-4">
14
- <input
15
- type="text"
16
- value={newModelName}
17
- onChange={e => onNameChange(e.target.value)}
18
- placeholder="Enter model name (e.g., facebook/wmt19-en-de)"
19
- className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500"
20
- />
21
- <button
22
- onClick={onEvaluate}
23
- disabled={isEvaluating}
24
- className={`px-4 py-2 rounded-lg font-medium text-white ${
25
- isEvaluating ? 'bg-gray-400' : 'bg-indigo-600 hover:bg-indigo-700'
26
- }`}
27
- >
28
- {isEvaluating ? 'Evaluating...' : 'Evaluate Model'}
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