Update app.py
Browse files
app.py
CHANGED
@@ -5,14 +5,14 @@ import concurrent.futures
|
|
5 |
def greet_para(params_text):
|
6 |
params = params_text.split("\n")
|
7 |
with concurrent.futures.ThreadPoolExecutor() as executor:
|
8 |
-
results = list(executor.map(
|
9 |
return results
|
10 |
|
11 |
def greet(name):
|
12 |
client = Client("Renecto/queue_10_limit")
|
13 |
-
r = client.submit(name=
|
14 |
return r.result()
|
15 |
|
16 |
-
demo = gr.Interface(fn=greet_para, inputs=
|
17 |
demo.launch()
|
18 |
|
|
|
5 |
def greet_para(params_text):
|
6 |
params = params_text.split("\n")
|
7 |
with concurrent.futures.ThreadPoolExecutor() as executor:
|
8 |
+
results = list(executor.map(greet, params))
|
9 |
return results
|
10 |
|
11 |
def greet(name):
|
12 |
client = Client("Renecto/queue_10_limit")
|
13 |
+
r = client.submit(name=name, api_name="/predict")
|
14 |
return r.result()
|
15 |
|
16 |
+
demo = gr.Interface(fn=greet_para, inputs=gr.textAArea(), outputs="json")
|
17 |
demo.launch()
|
18 |
|