Spaces:
Runtime error
Runtime error
mwitiderrick
commited on
Commit
•
d719c99
1
Parent(s):
89a4e78
Update app.py
Browse files
app.py
CHANGED
@@ -44,8 +44,8 @@ def run_pipeline(text):
|
|
44 |
sparse_result = dict(sparse_output)
|
45 |
sparse_end = time.perf_counter()
|
46 |
sparse_duration = (sparse_end - sparse_start) * 1000.0
|
47 |
-
|
48 |
-
return
|
49 |
|
50 |
|
51 |
with gr.Blocks() as demo:
|
@@ -61,7 +61,7 @@ with gr.Blocks() as demo:
|
|
61 |
btn = gr.Button("Submit")
|
62 |
|
63 |
sparse_answers = gr.Label(label="Sparse model answers",
|
64 |
-
num_top_classes=
|
65 |
)
|
66 |
sparse_duration = gr.Number(label="Sparse Latency (ms):")
|
67 |
gr.Examples([["The senate passed 3 laws today"],["Who are you voting for in 2020?"],["Public health is very important"]],inputs=[text],)
|
|
|
44 |
sparse_result = dict(sparse_output)
|
45 |
sparse_end = time.perf_counter()
|
46 |
sparse_duration = (sparse_end - sparse_start) * 1000.0
|
47 |
+
dict_r = {sparse_result['labels'][0]:sparse_result['scores'][0],sparse_result['labels'][1]:sparse_result['scores'][1], sparse_result['labels'][2]:sparse_result['scores'][2]}
|
48 |
+
return dict_r, sparse_duration
|
49 |
|
50 |
|
51 |
with gr.Blocks() as demo:
|
|
|
61 |
btn = gr.Button("Submit")
|
62 |
|
63 |
sparse_answers = gr.Label(label="Sparse model answers",
|
64 |
+
num_top_classes=3
|
65 |
)
|
66 |
sparse_duration = gr.Number(label="Sparse Latency (ms):")
|
67 |
gr.Examples([["The senate passed 3 laws today"],["Who are you voting for in 2020?"],["Public health is very important"]],inputs=[text],)
|