Spaces:
Sleeping
Sleeping
update app.py
Browse files
app.py
CHANGED
@@ -24,20 +24,26 @@ max_length = 30
|
|
24 |
|
25 |
|
26 |
import gradio as gr
|
27 |
-
def sentence_builder(txt):
|
28 |
txt_len = len(txt.split())
|
29 |
if(txt_len < 9): # To make up minumum requirement of 9 words
|
30 |
txt += " My lord, I claim your gift, my due by promise"
|
31 |
|
32 |
t_loader = DataLoaderLite(B = 8, T = 1, text_input = txt)
|
33 |
-
out = infer_the_model(device, t_loader, save1_or_load0 = 0)
|
34 |
return out
|
35 |
|
36 |
|
37 |
demo = gr.Interface(
|
38 |
sentence_builder,
|
39 |
[
|
40 |
-
gr.Textbox("", label = "Input", info="Give 8 words atleast, not to get concatenated with default words to make up it's minimum requirement.")
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
],
|
42 |
[
|
43 |
gr.Textbox("", label = "Output")
|
|
|
24 |
|
25 |
|
26 |
import gradio as gr
|
27 |
+
def sentence_builder(txt, new_tokens):
|
28 |
txt_len = len(txt.split())
|
29 |
if(txt_len < 9): # To make up minumum requirement of 9 words
|
30 |
txt += " My lord, I claim your gift, my due by promise"
|
31 |
|
32 |
t_loader = DataLoaderLite(B = 8, T = 1, text_input = txt)
|
33 |
+
out = infer_the_model(device, t_loader, save1_or_load0 = 0, new_tokens = 100)
|
34 |
return out
|
35 |
|
36 |
|
37 |
demo = gr.Interface(
|
38 |
sentence_builder,
|
39 |
[
|
40 |
+
gr.Textbox("", label = "Input", info="Give 8 words atleast, not to get concatenated with default words to make up it's minimum requirement."),
|
41 |
+
gr.Dropdown(
|
42 |
+
["100", "200", "300", "400", "500", "1000", "2000"],
|
43 |
+
label="New Tokens",
|
44 |
+
info="Choose how many tokens required in output.",
|
45 |
+
value="100"
|
46 |
+
)
|
47 |
],
|
48 |
[
|
49 |
gr.Textbox("", label = "Output")
|