LucaVivona commited on
Commit
e629239
β€’
1 Parent(s): 13797bf

backend fixed module bugs πŸ›

Browse files
backend/app.py CHANGED
@@ -2,10 +2,9 @@ from flask import Flask, jsonify, request
2
  from flask_cors import CORS
3
  import socket
4
  import argparse
5
- import src
6
- import importlib
7
- import asyncio
8
- from multiprocessing import Process
9
  import gradio as gr
10
 
11
  app = Flask(__name__)
 
2
  from flask_cors import CORS
3
  import socket
4
  import argparse
5
+ # import importlib
6
+ # import asyncio
7
+ # from multiprocessing import Process
 
8
  import gradio as gr
9
 
10
  app = Flask(__name__)
backend/src/__init__.py DELETED
@@ -1,3 +0,0 @@
1
- from .example import *
2
- import src.resources
3
- from src.demo import *
 
 
 
 
backend/src/demo/demo.py CHANGED
@@ -1,8 +1,8 @@
1
  import argparse
2
  import sys
3
 
4
- sys.path.insert(0, "../")
5
- from resources import GradioModule, register, InterLauncher, tabularGradio
6
  sys.path.insert(0, "../example")
7
  from examples import Pictionary, FSD, stock_forecast
8
 
 
1
  import argparse
2
  import sys
3
 
4
+ sys.path.insert(0, "../resources")
5
+ from module import GradioModule, register, InterLauncher, tabularGradio
6
  sys.path.insert(0, "../example")
7
  from examples import Pictionary, FSD, stock_forecast
8
 
backend/src/demo/module.py CHANGED
@@ -6,6 +6,6 @@ from src.resources import GradioModule, register
6
  def Hello_World(name):
7
  return f"πŸ‘‹ Hello {name}, and welcome to Gradio Flow πŸ€—"
8
 
9
- @register(["number", "number"], ["number"], examples=[[1,1]])
10
  def add(x, y):
11
- return x + y
 
6
  def Hello_World(name):
7
  return f"πŸ‘‹ Hello {name}, and welcome to Gradio Flow πŸ€—"
8
 
9
+ @register(inputs=["number", "number"], ouputs=["number"], examples=[[1,1]])
10
  def add(x, y):
11
+ return x + y
backend/src/example/examples.py CHANGED
@@ -7,8 +7,8 @@ import torch
7
  from torch import nn
8
  import numpy as np
9
  import PIL
10
- sys.path.insert(0, "../")
11
- from src.resources.module import GradioModule, register
12
 
13
 
14
  @GradioModule
 
7
  from torch import nn
8
  import numpy as np
9
  import PIL
10
+ sys.path.insert(0, "../resources")
11
+ from module import GradioModule, register
12
 
13
 
14
  @GradioModule