Spaces:
Running
Running
Update index.mjs
Browse files
index.mjs
CHANGED
@@ -2,7 +2,7 @@ import express from "express";
|
|
2 |
import 'dotenv/config.js'
|
3 |
import { createServer } from "http";
|
4 |
import { Server } from "socket.io";
|
5 |
-
import {
|
6 |
import { createRequire } from 'node:module'
|
7 |
const require = createRequire(import.meta.url);
|
8 |
global.EventSource = require('eventsource');
|
@@ -26,7 +26,7 @@ io.on("connection", (socket) => {
|
|
26 |
|
27 |
async function asyncAPICall(data, socket) {
|
28 |
|
29 |
-
const grapi = await
|
30 |
try{
|
31 |
const api_result = await grapi.predict("/infer", {
|
32 |
image_string: data[0], // blob in 'image' Image component
|
|
|
2 |
import 'dotenv/config.js'
|
3 |
import { createServer } from "http";
|
4 |
import { Server } from "socket.io";
|
5 |
+
import { client } from "@gradio/client";
|
6 |
import { createRequire } from 'node:module'
|
7 |
const require = createRequire(import.meta.url);
|
8 |
global.EventSource = require('eventsource');
|
|
|
26 |
|
27 |
async function asyncAPICall(data, socket) {
|
28 |
|
29 |
+
const grapi = await client.connect("fffiloni/mndrm-call");
|
30 |
try{
|
31 |
const api_result = await grapi.predict("/infer", {
|
32 |
image_string: data[0], // blob in 'image' Image component
|