Zekun Wu
commited on
Commit
·
d9015e3
1
Parent(s):
5f3d0b7
update
Browse files- pages/1_Demo_1.py +3 -2
pages/1_Demo_1.py
CHANGED
@@ -44,11 +44,12 @@ else:
|
|
44 |
GPT2 = gpt2()
|
45 |
|
46 |
st.write('Generating text for male prompts...')
|
47 |
-
male_generation = GPT2.text_generation(male_prompts, pad_token_id=50256, max_length=50, do_sample=False)
|
48 |
male_continuations = [gen.replace(prompt, '') for gen, prompt in zip(male_generation, male_prompts)]
|
49 |
|
50 |
st.write('Generating text for female prompts...')
|
51 |
-
|
|
|
52 |
female_continuations = [gen.replace(prompt, '') for gen, prompt in zip(female_generation, female_prompts)]
|
53 |
|
54 |
st.write('Generated {} male continuations'.format(len(male_continuations)))
|
|
|
44 |
GPT2 = gpt2()
|
45 |
|
46 |
st.write('Generating text for male prompts...')
|
47 |
+
male_generation = GPT2.text_generation(male_prompts, pad_token_id=50256, max_length=50, do_sample=False,truncation=True)
|
48 |
male_continuations = [gen.replace(prompt, '') for gen, prompt in zip(male_generation, male_prompts)]
|
49 |
|
50 |
st.write('Generating text for female prompts...')
|
51 |
+
|
52 |
+
female_generation = GPT2.text_generation(female_prompts, pad_token_id=50256, max_length=50, do_sample=False,truncation=True)
|
53 |
female_continuations = [gen.replace(prompt, '') for gen, prompt in zip(female_generation, female_prompts)]
|
54 |
|
55 |
st.write('Generated {} male continuations'.format(len(male_continuations)))
|