Spaces:
Runtime error
Runtime error
yash161101
commited on
Commit
•
38e3c04
1
Parent(s):
eed725f
Update app.py
Browse files
app.py
CHANGED
@@ -15,10 +15,12 @@ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
15 |
@st.cache(allow_output_mutation=True)
|
16 |
def get_model():
|
17 |
tokenizer = AutoTokenizer.from_pretrained("ml6team/gpt-2-medium-conditional-quote-generator")
|
18 |
-
model =
|
19 |
return model, tokenizer
|
20 |
-
|
|
|
21 |
model, tokenizer = get_model()
|
|
|
22 |
c = 5
|
23 |
with st.form(key='my_form'):
|
24 |
prompt = st.text_input('Enter sentence:', '')
|
|
|
15 |
@st.cache(allow_output_mutation=True)
|
16 |
def get_model():
|
17 |
tokenizer = AutoTokenizer.from_pretrained("ml6team/gpt-2-medium-conditional-quote-generator")
|
18 |
+
model = AutoModelForCausalLM.from_pretrained("ml6team/gpt-2-medium-conditional-quote-generator")
|
19 |
return model, tokenizer
|
20 |
+
|
21 |
+
|
22 |
model, tokenizer = get_model()
|
23 |
+
#g =
|
24 |
c = 5
|
25 |
with st.form(key='my_form'):
|
26 |
prompt = st.text_input('Enter sentence:', '')
|