CoolFace
Modelpublic

bluejwu/liberal-gpt2

sourceHugging Facemitupdated 2y agoView on Hugging Face
0likes17downloads
Model Card

liberal-gpt2

liberal-gpt2 is OpenAI's gpt2 fine tuned on news articles from liberal leaning news outlets (CNN, MSNBC and The New York Times) from the liberal-and-conservative-news dataset.

Final Eval Loss: 2.734

Example Usage

python
from transformers import GPT2TokenizerFast, GPT2LMHeadModel

tokenizer = GPT2TokenizerFast.from_pretrained("gpt2")
model = GPT2LMHeadModel.from_pretrained("bluejwu/liberal-gpt2")

prompt = "Once upon a time, Alice"

encoded_input = tokenizer(prompt, return_tensors="pt")

output_sequences = model.generate(
	input_ids=encoded_input["input_ids"],
	max_length=400,
	temperature=0.7,
	top_k=50,
	top_p=0.9,
	do_sample=True,
	pad_token_id=tokenizer.eos_token_id,
	repetition_penalty=1.01,
	no_repeat_ngram_size=6,
)

text = tokenizer.decode(output_sequences[0], skip_special_tokens=True)

print(text)

Example Output

_Prompt: "Once upon a time, Alice"_

Once upon a time, Alice and her husband, James, had been on a fishing trip together, and she was looking forward to seeing them again. They were both in their 50s. "I was really, really nervous about not having children," Alice recalled. "And I knew that if I didn't have children, I would have to do something drastic to help them. I was very sad, because I thought it was a terrible thing that I would do." In the spring of 2019, Alice was in her office when she received a call from her mother. She was pregnant with her second child, and she was worried about her future. "I said, 'Mom, I can't have a child. I can't have children.'" Alice said. "My mother told me, 'There is no way you can have children if you don't have kids.'" Alice's mother, Carol, told the family that if Alice had children, she would be very upset. "I'm not saying that I'm not upset," Carol said. "I'm just saying that it's just not right that we're living this way. I don't want to be with someone that is pregnant." At that point, Alice and her husband got into an argument. "She was saying, 'If I don't have children, I'm going to have to have to have an abortion.' And I said, 'I'm not going to have to have an ultrasound.' She said, 'You're not going to have to do that. You're not going to have an abortion. You're not going take that risk.'" When the fetus was born, Alice and her husband had to undergo an ultrasound to determine if the baby's development was normal. They were not able to do that for more than a week. In August 2020, the fetus underwent a full-term abortion, which allowed the couple to have

_Prompt: "Trump is"_

Trump is seeking to overturn the 2020 election results, which he claimed were stolen from him by the Russian government. Ahead of the 2024 presidential election, the former president's advisers have sought to cast the 2020 election as a fraud and a threat to democracy, portraying the election as an effort by Mr. Trump to reverse the results of the election in favor of his rival, Senator Tim Scott of South Carolina. Mr. Trump has also sought to cast the 2020 election as an attempt by Mr. Biden to reverse his victory in 2020, which he said was stolen from him by the Russian government. The efforts by Mr. Trump to cast the 2020 election as a "verdict" against him have been widely condemned by some Republicans and Democratic leaders, and have been met with widespread criticism. In an interview on Wednesday with The Wall Street Journal, Mr. Trump said he was "very proud" that he had won the election. "I won the election," he said. "I won a landslide victory. And I will continue to do that." Mr. Trump's campaign did not respond to a request for comment. Mr. Trump's advisers have sought to portray the 2020 election as a political witch hunt against him, and to highlight the role of his rivals. Mr. Trump's advisers have sought to portray the 2020 election as a fight over Mr. Biden's re-election, and to highlight the role of his rivals in the fight. "I think they're doing it to win," said Robert K. F. Kennedy Jr., a former Trump campaign adviser who has been a key figure in the efforts to overturn the election. "They're doing it to win the election." Mr. Kennedy, who served as Mr. Trump's chief strategist and chief strategist, said Mr. Trump's team had been "failing" in its efforts to get Mr. Biden to drop out of the race. He

License

This software is licensed under the `MIT-0` license. The intent is to effectively place this work in the public domain.

MIT No Attribution

Copyright 2024 Jonathan Wu

Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.