Spaces:
Running
Running
File size: 648 Bytes
e078b1d abf7059 fd61bce e078b1d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | import axios from "axios";
const api = axios.create({
// Use relative paths in production (Hugging Face) so it hits the same domain.
// In local dev, continue reaching out to FastAPI on port 8000.
baseURL: import.meta.env.PROD ? "" : "http://127.0.0.1:8001"
});
export async function summarizeText(payload) {
const { data } = await api.post("/summarize", payload);
return data;
}
export async function compareModels(payload) {
const { data } = await api.post("/compare", payload);
return data;
}
export async function fetchSamples(track) {
const { data } = await api.get(`/samples?track=${track}`);
return data.items || [];
}
|