Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import inspect
|
|
4 |
from gradio import routes
|
5 |
from typing import List, Type
|
6 |
|
7 |
-
import requests, os, re, asyncio
|
8 |
|
9 |
|
10 |
loop = asyncio.get_event_loop()
|
@@ -30,6 +30,7 @@ routes.get_types = get_types
|
|
30 |
|
31 |
# App code
|
32 |
def chat(x, id, url):
|
|
|
33 |
result = gradio_client.predict(
|
34 |
x,
|
35 |
# str representing input in 'User input' Textbox component
|
@@ -39,7 +40,14 @@ def chat(x, id, url):
|
|
39 |
fn_index=0
|
40 |
)
|
41 |
result = str(result)
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
return result
|
44 |
|
45 |
with gr.Blocks() as demo:
|
|
|
4 |
from gradio import routes
|
5 |
from typing import List, Type
|
6 |
|
7 |
+
import requests, os, re, asyncio, time
|
8 |
|
9 |
|
10 |
loop = asyncio.get_event_loop()
|
|
|
30 |
|
31 |
# App code
|
32 |
def chat(x, id, url):
|
33 |
+
start = time.time()
|
34 |
result = gradio_client.predict(
|
35 |
x,
|
36 |
# str representing input in 'User input' Textbox component
|
|
|
40 |
fn_index=0
|
41 |
)
|
42 |
result = str(result)
|
43 |
+
|
44 |
+
end = time.time()
|
45 |
+
|
46 |
+
|
47 |
+
sec = (end - start)
|
48 |
+
result_list = str(datetime.timedelta(seconds=sec)).split(".")
|
49 |
+
print()
|
50 |
+
print("응답 시간 : " + result_list[0] +"\n"+ x +", "+ id +", "+ url +", "+ result)
|
51 |
return result
|
52 |
|
53 |
with gr.Blocks() as demo:
|