Spaces:
Runtime error
Runtime error
Commit
·
72302dd
1
Parent(s):
cbcc475
Update app.py
Browse files
app.py
CHANGED
@@ -9,10 +9,10 @@ generator = pipeline('text-generation', model='EleutherAI/gpt-neo-125M')
|
|
9 |
|
10 |
min_length=st.slider(
|
11 |
'Specify Min length of the text of want to be generated',
|
12 |
-
10, 100,
|
13 |
max_length=st.slider(
|
14 |
'Specify Max length of the text of want to be generated',
|
15 |
-
20, 150,
|
16 |
|
17 |
# create a prompt text for the text generation
|
18 |
prompt_text = st.text_input(
|
@@ -24,11 +24,10 @@ if(max_length<=min_length):
|
|
24 |
st.error("max_length cannot be less than equal to min_length")
|
25 |
else:
|
26 |
with st.spinner("AI is at Work........"):
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
st.write(gpt_text)
|
|
|
9 |
|
10 |
min_length=st.slider(
|
11 |
'Specify Min length of the text of want to be generated',
|
12 |
+
10, 100, 20)
|
13 |
max_length=st.slider(
|
14 |
'Specify Max length of the text of want to be generated',
|
15 |
+
20, 150, 30)
|
16 |
|
17 |
# create a prompt text for the text generation
|
18 |
prompt_text = st.text_input(
|
|
|
24 |
st.error("max_length cannot be less than equal to min_length")
|
25 |
else:
|
26 |
with st.spinner("AI is at Work........"):
|
27 |
+
gpt_text = generator(
|
28 |
+
prompt_text,
|
29 |
+
min_length=min_length,
|
30 |
+
max_length=max_length,
|
31 |
+
do_sample=True)[0]["generated_text"]
|
32 |
+
st.success("Successfully generated the below text:")
|
33 |
+
st.write(gpt_text)
|
|