Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import os
|
|
5 |
import torch
|
6 |
import torch.nn as nn
|
7 |
from transformers.activations import get_activation
|
8 |
-
from transformers import AutoTokenizer, AutoModelWithLMHead
|
9 |
st.title('GPT2:')
|
10 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
11 |
@st.cache(allow_output_mutation=True)
|
@@ -21,8 +21,9 @@ def get_model():
|
|
21 |
#model = AutoModelWithLMHead.from_pretrained("BigSalmon/InformalToFormalLincoln26")
|
22 |
#model = AutoModelWithLMHead.from_pretrained("BigSalmon/InformalToFormalLincoln27")
|
23 |
#model = AutoModelWithLMHead.from_pretrained("BigSalmon/InformalToFormalLincoln28")
|
|
|
24 |
tokenizer = AutoTokenizer.from_pretrained("BigSalmon/GPTNeo350MInformalToFormalLincoln")
|
25 |
-
model =
|
26 |
model.to(device)
|
27 |
return model, tokenizer
|
28 |
|
|
|
5 |
import torch
|
6 |
import torch.nn as nn
|
7 |
from transformers.activations import get_activation
|
8 |
+
from transformers import AutoTokenizer, AutoModelWithLMHead, AutoModelForCausalLM
|
9 |
st.title('GPT2:')
|
10 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
11 |
@st.cache(allow_output_mutation=True)
|
|
|
21 |
#model = AutoModelWithLMHead.from_pretrained("BigSalmon/InformalToFormalLincoln26")
|
22 |
#model = AutoModelWithLMHead.from_pretrained("BigSalmon/InformalToFormalLincoln27")
|
23 |
#model = AutoModelWithLMHead.from_pretrained("BigSalmon/InformalToFormalLincoln28")
|
24 |
+
#model = AutoModelWithLMHead.from_pretrained("BigSalmon/InformalToFormalLincoln29")
|
25 |
tokenizer = AutoTokenizer.from_pretrained("BigSalmon/GPTNeo350MInformalToFormalLincoln")
|
26 |
+
model = AutoModelForCausalLM.from_pretrained("BigSalmon/InformalToFormalLincoln30")
|
27 |
model.to(device)
|
28 |
return model, tokenizer
|
29 |
|