Spaces:
Configuration error
Configuration error
Commit
Β·
b4fcff9
1
Parent(s):
c132e32
Non Class Function Decorator π§βπ¨
Browse files- backend/src/demo.py +4 -6
backend/src/demo.py
CHANGED
|
@@ -1,15 +1,13 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
def Hello_World(name):
|
| 5 |
return f"Hello {name}, and welcome to Gradio Flow π€"
|
| 6 |
|
|
|
|
| 7 |
def add(x, y):
|
| 8 |
return x + y
|
| 9 |
|
| 10 |
if __name__ == "__main__":
|
| 11 |
-
|
| 12 |
-
#tabularGradio([Hello_World(), add()], ["hello world", "add"], listen=2000)
|
| 13 |
-
#print([key for key, _ in doc.__dict__.items() if not key.startswith("__")])
|
| 14 |
-
#d = Dock()
|
| 15 |
-
#print(d.determinePort(), d2.port_count)
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from resources import register, tabularGradio
|
| 3 |
|
| 4 |
+
@register(["text"], ["text"], examples=[["Luca Vivona"]])
|
| 5 |
def Hello_World(name):
|
| 6 |
return f"Hello {name}, and welcome to Gradio Flow π€"
|
| 7 |
|
| 8 |
+
@register(["number"], ["number"], examples=[[1,1]])
|
| 9 |
def add(x, y):
|
| 10 |
return x + y
|
| 11 |
|
| 12 |
if __name__ == "__main__":
|
| 13 |
+
tabularGradio([Hello_World()], ["Hello World"])
|
|
|
|
|
|
|
|
|
|
|
|