Siddharth Ravikumar commited on
Commit
f658e30
·
1 Parent(s): 8273d80

Fix gradio API call paths after removing /api prefix

Browse files
Files changed (1) hide show
  1. frontend/js/alt_app.js +2 -2
frontend/js/alt_app.js CHANGED
@@ -18,7 +18,7 @@ let additionalFiles = []; // For add photos modal
18
 
19
  // Gradio API Helper for ZeroGPU Event Streams
20
  async function callGradioApi(apiName, dataArr) {
21
- const res = await fetch('/call/' + apiName, {
22
  method: 'POST',
23
  headers: { 'Content-Type': 'application/json' },
24
  body: JSON.stringify({ data: dataArr })
@@ -32,7 +32,7 @@ async function callGradioApi(apiName, dataArr) {
32
  const eventId = eventObj.event_id;
33
 
34
  return new Promise((resolve, reject) => {
35
- const source = new EventSource('/call/' + apiName + '/' + eventId);
36
  source.onmessage = (e) => {
37
  const msg = JSON.parse(e.data);
38
  if (msg.msg === 'process_completed') {
 
18
 
19
  // Gradio API Helper for ZeroGPU Event Streams
20
  async function callGradioApi(apiName, dataArr) {
21
+ const res = await fetch('/gradio_api/call/' + apiName, {
22
  method: 'POST',
23
  headers: { 'Content-Type': 'application/json' },
24
  body: JSON.stringify({ data: dataArr })
 
32
  const eventId = eventObj.event_id;
33
 
34
  return new Promise((resolve, reject) => {
35
+ const source = new EventSource('/gradio_api/call/' + apiName + '/' + eventId);
36
  source.onmessage = (e) => {
37
  const msg = JSON.parse(e.data);
38
  if (msg.msg === 'process_completed') {