Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,9 @@
|
|
1 |
import subprocess
|
2 |
-
|
|
|
3 |
|
4 |
import gradio as gr
|
|
|
5 |
from textgen import load
|
6 |
|
7 |
textgen = load()
|
@@ -16,13 +18,13 @@ with gr.Blocks() as app:
|
|
16 |
text = gr.TextArea(label="Text")
|
17 |
with gr.Row():
|
18 |
length = gr.Number(label="Length", value=25)
|
19 |
-
|
20 |
with gr.Row(variant="panel"):
|
21 |
btn = gr.Button("Generate", variant="primary")
|
22 |
clear = gr.Button("Clear")
|
23 |
-
|
24 |
btn.click(generate, [text, length], [text])
|
25 |
-
clear.click(lambda: "",
|
26 |
-
|
27 |
if __name__ == "__main__":
|
28 |
app.queue().launch(debug=True, ssr_mode=False)
|
|
|
1 |
import subprocess
|
2 |
+
|
3 |
+
subprocess.run("pip install ./textgen.zip", shell=True)
|
4 |
|
5 |
import gradio as gr
|
6 |
+
|
7 |
from textgen import load
|
8 |
|
9 |
textgen = load()
|
|
|
18 |
text = gr.TextArea(label="Text")
|
19 |
with gr.Row():
|
20 |
length = gr.Number(label="Length", value=25)
|
21 |
+
|
22 |
with gr.Row(variant="panel"):
|
23 |
btn = gr.Button("Generate", variant="primary")
|
24 |
clear = gr.Button("Clear")
|
25 |
+
|
26 |
btn.click(generate, [text, length], [text])
|
27 |
+
clear.click(lambda: "", [text], [text], queue=False)
|
28 |
+
|
29 |
if __name__ == "__main__":
|
30 |
app.queue().launch(debug=True, ssr_mode=False)
|