BigSalmon commited on
Commit
b5b7a59
·
1 Parent(s): e1311b9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -8
app.py CHANGED
@@ -14,16 +14,11 @@ st.title('KoGPT2 Demo')
14
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
15
 
16
 
17
- @st.cache(allow_output_mutation=True)
18
- def load_model():
19
- tokenizer = AutoTokenizer.from_pretrained("gpt2")
20
- model = AutoModelWithLMHead.from_pretrained("BigSalmon/MrLincoln10")
21
- return tokenizer, model
22
 
23
- load_model()
 
24
 
25
- g = """
26
- informal english: the vice president is not automatically entitled to the nomination, if they are unpopular.
27
  Translated into the Style of Abraham Lincoln: should they be abhorred, the vice president is not above ( sparring with challengers for the nomination / brawling for the nomination / facing a spirited challenge for the nomination / braving a bout for the nomination ).
28
  Translated into the Style of Abraham Lincoln: the office of vice president is no entitlement to the honor of the nomination, should their popularity ( fail to measure up / be in question / be lacking ).
29
  Translated into the Style of Abraham Lincoln: without ( popular backing / public adulation / favorable reviews / a passing consensus ), the vice president ( is not above / cannot hope to dodge / should not think themselves above / should not bank on evading / should not harbor any illusions of skirting ) a nomination challenge.
 
14
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
15
 
16
 
 
 
 
 
 
17
 
18
+ tokenizer = AutoTokenizer.from_pretrained("gpt2")
19
+ model = AutoModelWithLMHead.from_pretrained("BigSalmon/MrLincoln10")
20
 
21
+ g = """informal english: the vice president is not automatically entitled to the nomination, if they are unpopular.
 
22
  Translated into the Style of Abraham Lincoln: should they be abhorred, the vice president is not above ( sparring with challengers for the nomination / brawling for the nomination / facing a spirited challenge for the nomination / braving a bout for the nomination ).
23
  Translated into the Style of Abraham Lincoln: the office of vice president is no entitlement to the honor of the nomination, should their popularity ( fail to measure up / be in question / be lacking ).
24
  Translated into the Style of Abraham Lincoln: without ( popular backing / public adulation / favorable reviews / a passing consensus ), the vice president ( is not above / cannot hope to dodge / should not think themselves above / should not bank on evading / should not harbor any illusions of skirting ) a nomination challenge.