Spaces:
Configuration error
Configuration error
Commit
Β·
2d6a1ff
1
Parent(s):
5234615
README.md/pre-existing bugs fixed π
Browse files- README.md +12 -3
- backend/requirements.txt +3 -3
- backend/src/demoE.py +1 -1
- backend/src/resources/module.py +2 -5
README.md
CHANGED
@@ -42,8 +42,11 @@ stream both [Gradio](https://gradio.app) ( and later [Streamlit](https://streaml
|
|
42 |
|
43 |
- [**Application**](#application-%EF%B8%8F)
|
44 |
|
45 |
-
|
46 |
### Backend π½
|
|
|
|
|
|
|
47 |
- ``__init__`` function takes inputs within class wrapper
|
48 |
- better determine registered functions within classes
|
49 |
- more examples located in the ``backend/src/example``
|
@@ -55,7 +58,7 @@ def InterLauncher(name, interface, listen=2000, **kwargs):
|
|
55 |
port= kwargs["port"] if "port" in kwargs else DOCKER_PORT.determinePort()
|
56 |
print(listen)
|
57 |
try:
|
58 |
-
requests.post(f"http://{DOCKER_LOCAL_HOST}:{listen}/api/append/port", json={"port" : port, "host" : f'http://localhost:{port}', "file" :
|
59 |
except Exception as e:
|
60 |
print(f"**{bcolor.BOLD}{bcolor.FAIL}CONNECTION ERROR{bcolor.ENDC}** πThe listening api is either not up or you choose the wrong port.π \n {e}")
|
61 |
return
|
@@ -89,7 +92,13 @@ def InterLauncher(name, interface, listen=2000, **kwargs):
|
|
89 |
|
90 |
|
91 |
### Frontend π₯οΈ
|
92 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
|
94 |
## App Architecture ποΈ
|
95 |

|
|
|
42 |
|
43 |
- [**Application**](#application-%EF%B8%8F)
|
44 |
|
45 |
+
### Updates βοΈ
|
46 |
### Backend π½
|
47 |
+
- errors within the function InterLauncher fixed
|
48 |
+
- port mapping fixed
|
49 |
+
- removed test prints
|
50 |
- ``__init__`` function takes inputs within class wrapper
|
51 |
- better determine registered functions within classes
|
52 |
- more examples located in the ``backend/src/example``
|
|
|
58 |
port= kwargs["port"] if "port" in kwargs else DOCKER_PORT.determinePort()
|
59 |
print(listen)
|
60 |
try:
|
61 |
+
requests.post(f"http://{DOCKER_LOCAL_HOST}:{listen}/api/append/port", json={"port" : port, "host" : f'http://localhost:{port}', "file" : name, "name" : "Not Applicable", "kwargs" : kwargs})
|
62 |
except Exception as e:
|
63 |
print(f"**{bcolor.BOLD}{bcolor.FAIL}CONNECTION ERROR{bcolor.ENDC}** πThe listening api is either not up or you choose the wrong port.π \n {e}")
|
64 |
return
|
|
|
92 |
|
93 |
|
94 |
### Frontend π₯οΈ
|
95 |
+
- new logo
|
96 |
+
|
97 |
+
### In The Works π§
|
98 |
+
- Appending streamlit into gradio-flow
|
99 |
+
- Directory tree search that looks for files that contain classes and functions that are registered under the decorators that are in ``backend/src/resources`` allowing you to append all your registered functions with only using the frontend.
|
100 |
+
|
101 |
+
|
102 |
|
103 |
## App Architecture ποΈ
|
104 |

|
backend/requirements.txt
CHANGED
@@ -61,10 +61,10 @@ six==1.16.0
|
|
61 |
sniffio==1.2.0
|
62 |
starlette==0.19.1
|
63 |
gradioWrapper==0.0.4
|
64 |
-
|
65 |
-
|
66 |
tqdm==4.64.0
|
67 |
-
|
68 |
typing_extensions==4.3.0
|
69 |
uc-micro-py==1.0.1
|
70 |
urllib3==1.26.10
|
|
|
61 |
sniffio==1.2.0
|
62 |
starlette==0.19.1
|
63 |
gradioWrapper==0.0.4
|
64 |
+
tokenizers==0.12.1
|
65 |
+
torch==1.12.0
|
66 |
tqdm==4.64.0
|
67 |
+
transformers==4.20.1
|
68 |
typing_extensions==4.3.0
|
69 |
uc-micro-py==1.0.1
|
70 |
urllib3==1.26.10
|
backend/src/demoE.py
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
from example.examples import Pictionary, FSD, HelloWorld_2_0, stock_forecast
|
2 |
|
3 |
-
Pictionary("./example/data/labels.txt", "./example/data/pytorch_model.bin").launch(live=True, listen=2000
|
|
|
1 |
from example.examples import Pictionary, FSD, HelloWorld_2_0, stock_forecast
|
2 |
|
3 |
+
Pictionary("./example/data/labels.txt", "./example/data/pytorch_model.bin").launch(live=True, listen=2000)
|
backend/src/resources/module.py
CHANGED
@@ -9,7 +9,7 @@ class Dock:
|
|
9 |
|
10 |
def __init__(self) -> None:
|
11 |
self.num_ports = 20
|
12 |
-
self.port_range = (
|
13 |
|
14 |
def portConnection(self, port : int):
|
15 |
s = socket.socket(
|
@@ -22,7 +22,6 @@ class Dock:
|
|
22 |
trial_count = 0
|
23 |
while trial_count <= max_trial_count:
|
24 |
port=random.randint(*self.port_range)
|
25 |
-
print(port)
|
26 |
if not self.portConnection(port):
|
27 |
return port
|
28 |
trial_count += 1
|
@@ -34,9 +33,8 @@ DOCKER_PORT = Dock()
|
|
34 |
|
35 |
def InterLauncher(name, interface, listen=2000, **kwargs):
|
36 |
port= kwargs["port"] if "port" in kwargs else DOCKER_PORT.determinePort()
|
37 |
-
print(listen)
|
38 |
try:
|
39 |
-
requests.post(f"http://{DOCKER_LOCAL_HOST}:{listen}/api/append/port", json={"port" : port, "host" : f'http://localhost:{port}', "file" : "Not Applicable", "name" :
|
40 |
except Exception as e:
|
41 |
print(f"**{bcolor.BOLD}{bcolor.FAIL}CONNECTION ERROR{bcolor.ENDC}** πThe listening api is either not up or you choose the wrong port.π \n {e}")
|
42 |
return
|
@@ -214,7 +212,6 @@ def GradioModule(cls):
|
|
214 |
fn = getattr(self.__cls__, func, None)
|
215 |
|
216 |
if callable(fn) and not func.startswith("__") and "__decorator__" in dir(fn) and fn.__decorator__ == "__gradio__":
|
217 |
-
print(func, callable(fn))
|
218 |
fn()
|
219 |
|
220 |
def __compile(self):
|
|
|
9 |
|
10 |
def __init__(self) -> None:
|
11 |
self.num_ports = 20
|
12 |
+
self.port_range = (7860, 7880)
|
13 |
|
14 |
def portConnection(self, port : int):
|
15 |
s = socket.socket(
|
|
|
22 |
trial_count = 0
|
23 |
while trial_count <= max_trial_count:
|
24 |
port=random.randint(*self.port_range)
|
|
|
25 |
if not self.portConnection(port):
|
26 |
return port
|
27 |
trial_count += 1
|
|
|
33 |
|
34 |
def InterLauncher(name, interface, listen=2000, **kwargs):
|
35 |
port= kwargs["port"] if "port" in kwargs else DOCKER_PORT.determinePort()
|
|
|
36 |
try:
|
37 |
+
requests.post(f"http://{DOCKER_LOCAL_HOST}:{listen}/api/append/port", json={"port" : port, "host" : f'http://localhost:{port}', "file" : "Not Applicable", "name" : name, "kwargs" : kwargs})
|
38 |
except Exception as e:
|
39 |
print(f"**{bcolor.BOLD}{bcolor.FAIL}CONNECTION ERROR{bcolor.ENDC}** πThe listening api is either not up or you choose the wrong port.π \n {e}")
|
40 |
return
|
|
|
212 |
fn = getattr(self.__cls__, func, None)
|
213 |
|
214 |
if callable(fn) and not func.startswith("__") and "__decorator__" in dir(fn) and fn.__decorator__ == "__gradio__":
|
|
|
215 |
fn()
|
216 |
|
217 |
def __compile(self):
|