import axios from 'axios';

const BASE_URL = 'http://127.0.0.1:5000'; // 替换为 Flask 服务的实际地址
export const predict = async (data: any) => {
  try {
    const response = await axios.post(`${BASE_URL}/predict`, { data });
    return response.data;
  } catch (error) {
    console.error('Error while predicting:', error);
    throw error;
  }
};
