Spaces:
Sleeping
Sleeping
fvancesco
commited on
Commit
·
3c16c9f
1
Parent(s):
0487285
add initial plot
Browse files- app.py +3 -2
- plot_example.p +0 -0
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import numpy as np
|
|
|
2 |
from transformers import pipeline
|
3 |
from transformers import AutoModelForMaskedLM, AutoTokenizer
|
4 |
|
@@ -111,10 +112,10 @@ with gr.Blocks() as demo:
|
|
111 |
generate_btn = gr.Button("Generate Plot")
|
112 |
mask_btn = gr.Button("Add <mask>")
|
113 |
|
114 |
-
|
|
|
115 |
|
116 |
#textbox.change(fn=plot_time, inputs=textbox, outputs=plot)
|
117 |
-
#textbox.click(fn=plot_time, inputs=textbox, outputs=plot)
|
118 |
generate_btn.click(fn=plot_time, inputs=textbox, outputs=plot)
|
119 |
mask_btn.click(fn=add_mask, inputs=textbox, outputs=textbox)
|
120 |
|
|
|
1 |
import numpy as np
|
2 |
+
import pickle
|
3 |
from transformers import pipeline
|
4 |
from transformers import AutoModelForMaskedLM, AutoTokenizer
|
5 |
|
|
|
112 |
generate_btn = gr.Button("Generate Plot")
|
113 |
mask_btn = gr.Button("Add <mask>")
|
114 |
|
115 |
+
plot_example = pickle.load(open("plot_example.p", "rb"))
|
116 |
+
plot = gr.Plot(plot_example)
|
117 |
|
118 |
#textbox.change(fn=plot_time, inputs=textbox, outputs=plot)
|
|
|
119 |
generate_btn.click(fn=plot_time, inputs=textbox, outputs=plot)
|
120 |
mask_btn.click(fn=add_mask, inputs=textbox, outputs=textbox)
|
121 |
|
plot_example.p
ADDED
Binary file (503 kB). View file
|
|