Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ import torch
|
|
6 |
import torch.nn as nn
|
7 |
from transformers.activations import get_activation
|
8 |
from transformers import AutoTokenizer, AutoModelWithLMHead, AutoModelForCausalLM
|
9 |
-
|
10 |
st.title('GPT2: To see all prompt outlines: https://huggingface.co/BigSalmon/InformalToFormalLincoln46')
|
11 |
#device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
12 |
number_of_outputs = st.sidebar.slider("Number of Outputs", 50, 350)
|
@@ -37,8 +37,10 @@ def get_model():
|
|
37 |
#model = AutoModelForCausalLM.from_pretrained("BigSalmon/InformalToFormalLincoln46")
|
38 |
#model = AutoModelForCausalLM.from_pretrained("BigSalmon/InformalToFormalLincoln52")
|
39 |
#model = AutoModelForCausalLM.from_pretrained("BigSalmon/Points4")
|
40 |
-
tokenizer = AutoTokenizer.from_pretrained("BigSalmon/InformalToFormalLincoln56")
|
41 |
-
model = AutoModelForCausalLM.from_pretrained("BigSalmon/InformalToFormalLincoln56")
|
|
|
|
|
42 |
return model, tokenizer
|
43 |
|
44 |
model, tokenizer = get_model()
|
|
|
6 |
import torch.nn as nn
|
7 |
from transformers.activations import get_activation
|
8 |
from transformers import AutoTokenizer, AutoModelWithLMHead, AutoModelForCausalLM
|
9 |
+
from transformers import XGLMTokenizer, XGLMForCausalLM
|
10 |
st.title('GPT2: To see all prompt outlines: https://huggingface.co/BigSalmon/InformalToFormalLincoln46')
|
11 |
#device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
12 |
number_of_outputs = st.sidebar.slider("Number of Outputs", 50, 350)
|
|
|
37 |
#model = AutoModelForCausalLM.from_pretrained("BigSalmon/InformalToFormalLincoln46")
|
38 |
#model = AutoModelForCausalLM.from_pretrained("BigSalmon/InformalToFormalLincoln52")
|
39 |
#model = AutoModelForCausalLM.from_pretrained("BigSalmon/Points4")
|
40 |
+
#tokenizer = AutoTokenizer.from_pretrained("BigSalmon/InformalToFormalLincoln56")
|
41 |
+
#model = AutoModelForCausalLM.from_pretrained("BigSalmon/InformalToFormalLincoln56")
|
42 |
+
tokenizer = XGLMTokenizer.from_pretrained("facebook/xglm-564M")
|
43 |
+
model = XGLMForCausalLM.from_pretrained("facebook/xglm-564M")
|
44 |
return model, tokenizer
|
45 |
|
46 |
model, tokenizer = get_model()
|