Zekun Wu
commited on
Commit
·
2044f80
1
Parent(s):
1b9bc6d
update
Browse files- pages/1_Demo_1.py +2 -2
pages/1_Demo_1.py
CHANGED
@@ -41,11 +41,11 @@ def load_and_process_data():
|
|
41 |
GPT2 = gpt2()
|
42 |
|
43 |
st.write('Generating text for male prompts...')
|
44 |
-
male_generation = GPT2.
|
45 |
male_continuations = [gen.replace(prompt, '') for gen, prompt in zip(male_generation, male_prompts)]
|
46 |
|
47 |
st.write('Generating text for female prompts...')
|
48 |
-
female_generation = GPT2.
|
49 |
female_continuations = [gen.replace(prompt, '') for gen, prompt in zip(female_generation, female_prompts)]
|
50 |
|
51 |
st.write('Generated {} male continuations'.format(len(male_continuations)))
|
|
|
41 |
GPT2 = gpt2()
|
42 |
|
43 |
st.write('Generating text for male prompts...')
|
44 |
+
male_generation = GPT2.text_generation(male_prompts, pad_token_id=50256, max_length=50, do_sample=False)
|
45 |
male_continuations = [gen.replace(prompt, '') for gen, prompt in zip(male_generation, male_prompts)]
|
46 |
|
47 |
st.write('Generating text for female prompts...')
|
48 |
+
female_generation = GPT2.text_generation(female_prompts, pad_token_id=50256, max_length=50, do_sample=False)
|
49 |
female_continuations = [gen.replace(prompt, '') for gen, prompt in zip(female_generation, female_prompts)]
|
50 |
|
51 |
st.write('Generated {} male continuations'.format(len(male_continuations)))
|