File size: 425 Bytes
1af45d7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import axios from 'axios';
import { ModelData, ModelMetrics } from '../types';

const api = axios.create({
baseURL: process.env.REACT_APP_API_URL,
timeout: 10000,
});

export interface ApiResult {
  model: string;
  metrics: ModelData;
}

export const fetchResults = () => api.get<ApiResult[]>('/results');
export const evaluateModel = (model_name: string) => api.post<{ metrics: ModelMetrics }>('/evaluate', { model_name });