Spaces:
Sleeping
Sleeping
| import axios from 'axios'; | |
| import type { PredictionResponse } from '../types'; | |
| const api = axios.create({ | |
| baseURL: '/api', | |
| }); | |
| export async function predictImage(file: File): Promise<PredictionResponse> { | |
| const formData = new FormData(); | |
| formData.append('file', file); | |
| const { data } = await api.post<PredictionResponse>('/predict', formData); | |
| return data; | |
| } | |
| export default api; | |