Spaces:
Configuration error
Configuration error
LucaVivona
commited on
Commit
β’
e629239
1
Parent(s):
13797bf
backend fixed module bugs π
Browse files- backend/app.py +3 -4
- backend/src/__init__.py +0 -3
- backend/src/demo/demo.py +2 -2
- backend/src/demo/module.py +2 -2
- backend/src/example/examples.py +2 -2
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
|
6 |
-
import
|
7 |
-
import
|
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
|
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 |
-
|
|
|
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
|
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
|