Spaces:
Runtime error
Runtime error
vinayakdev
commited on
Commit
·
e2e14fd
1
Parent(s):
ae4c218
Happy hugging face
Browse files- generator.py +5 -5
generator.py
CHANGED
@@ -35,12 +35,12 @@ import streamlit as st
|
|
35 |
# hfmodel = pickle.load(open('models/hfmodel.sav', 'rb'))
|
36 |
@st.cache
|
37 |
def load_model():
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
model = amqa.from_pretrained("ahotrod/albert_xxlargev1_squad2_512")
|
42 |
-
|
43 |
-
load_model()
|
44 |
|
45 |
def run_model(input_string, **generator_args):
|
46 |
generator_args = {
|
|
|
35 |
# hfmodel = pickle.load(open('models/hfmodel.sav', 'rb'))
|
36 |
@st.cache
|
37 |
def load_model():
|
38 |
+
hfm = alwm.from_pretrained("ThomasSimonini/t5-end2end-question-generation")
|
39 |
+
hft = T5TokenizerFast.from_pretrained("t5-base")
|
40 |
+
tok = att.from_pretrained("ahotrod/albert_xxlargev1_squad2_512")
|
41 |
model = amqa.from_pretrained("ahotrod/albert_xxlargev1_squad2_512")
|
42 |
+
return hfm, hft,tok, model
|
43 |
+
hfmodel, hftokenizer, tokenizer, model = load_model()
|
44 |
|
45 |
def run_model(input_string, **generator_args):
|
46 |
generator_args = {
|