Spaces:
Sleeping
Sleeping
update app.py
Browse files
app.py
CHANGED
@@ -24,13 +24,13 @@ max_length = 30
|
|
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, max_length = int(new_tokens))
|
34 |
return out
|
35 |
|
36 |
|
@@ -39,10 +39,16 @@ demo = gr.Interface(
|
|
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 |
-
["
|
43 |
label="New Tokens",
|
44 |
info="Choose how many tokens required in output.",
|
45 |
-
value="
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
)
|
47 |
],
|
48 |
[
|
|
|
24 |
|
25 |
|
26 |
import gradio as gr
|
27 |
+
def sentence_builder(txt, new_tokens, ret_seq):
|
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, max_length = int(new_tokens), num_return_sequences=int(ret_seq))
|
34 |
return out
|
35 |
|
36 |
|
|
|
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 |
+
["10", "20", "30", "40", "50", "60", "80", "100"],
|
43 |
label="New Tokens",
|
44 |
info="Choose how many tokens required in output.",
|
45 |
+
value="30"
|
46 |
+
),
|
47 |
+
gr.Dropdown(
|
48 |
+
["1", "2", "3", "4", "5", "6", "8", "10"],
|
49 |
+
label="Number of Return Sequences",
|
50 |
+
info="Choose how many return sequences are required in output.",
|
51 |
+
value="30"
|
52 |
)
|
53 |
],
|
54 |
[
|