Spaces:
Running
Running
Update script.js
Browse files15 unmodified lines1617181920212223242526272829303132333435363738394 unmodified lines444546293031323334354748495051525354555615 unmodified lines "https://api-inference.huggingface.co/models/Jovie/Midjourney"]
// async function query(data) {// const response = await fetch(modelLinks[2], {// headers: {// Authorization: `Bearer ${token}`,// "Content-Type": "application/json",// },// method: "POST",// body: JSON.stringify(data),// });
// if (!response.ok) {// const err = await response.text();// throw new Error(err);// }
// return await response.blob();// }
async function query(data) { const response = await fetch(modelLinks[2], { headers: {4 unmodified lines body: JSON.stringify(data), });
if (!response.ok) { const err = await response.text(); throw new Error(err); }
return await response.blob();} console.log("Status:", response.status);
const text = await response.text(); console.log("Response:", text);
return new Blob([text]);}
script.js+23-7