Spaces:
Running
Running
ashhadahsan
commited on
Commit
·
7d8285a
1
Parent(s):
33bc558
Update app.py
Browse files
app.py
CHANGED
@@ -32,7 +32,7 @@ model_classes ={
|
|
32 |
13: "WiFi",
|
33 |
}
|
34 |
|
35 |
-
@st.cache(allow_output_mutation=
|
36 |
def load_t5():
|
37 |
model = AutoModelForSeq2SeqLM.from_pretrained("t5-base")
|
38 |
|
@@ -40,23 +40,23 @@ def load_t5():
|
|
40 |
return model, tokenizer
|
41 |
|
42 |
|
43 |
-
@st.cache(allow_output_mutation=
|
44 |
def custom_model():
|
45 |
return pipeline("summarization", model="my_awesome_sum/")
|
46 |
|
47 |
|
48 |
-
@st.cache(allow_output_mutation=
|
49 |
def convert_df(df):
|
50 |
# IMPORTANT: Cache the conversion to prevent computation on every rerun
|
51 |
return df.to_csv(index=False).encode("utf-8")
|
52 |
|
53 |
|
54 |
-
@st.cache(allow_output_mutation=
|
55 |
def load_one_line_summarizer(model):
|
56 |
return model.load_model("t5", "snrspeaks/t5-one-line-summary")
|
57 |
|
58 |
|
59 |
-
@st.cache(allow_output_mutation=
|
60 |
def classify_category():
|
61 |
tokenizer = BertTokenizer.from_pretrained("bert-base-uncased")
|
62 |
new_model = load_model("model")
|
|
|
32 |
13: "WiFi",
|
33 |
}
|
34 |
|
35 |
+
@st.cache(allow_output_mutation=True,suppress_st_warning=True)
|
36 |
def load_t5():
|
37 |
model = AutoModelForSeq2SeqLM.from_pretrained("t5-base")
|
38 |
|
|
|
40 |
return model, tokenizer
|
41 |
|
42 |
|
43 |
+
@st.cache(allow_output_mutation=True,suppress_st_warning=True)
|
44 |
def custom_model():
|
45 |
return pipeline("summarization", model="my_awesome_sum/")
|
46 |
|
47 |
|
48 |
+
@st.cache(allow_output_mutation=True,suppress_st_warning=True)
|
49 |
def convert_df(df):
|
50 |
# IMPORTANT: Cache the conversion to prevent computation on every rerun
|
51 |
return df.to_csv(index=False).encode("utf-8")
|
52 |
|
53 |
|
54 |
+
@st.cache(allow_output_mutation=True,suppress_st_warning=True)
|
55 |
def load_one_line_summarizer(model):
|
56 |
return model.load_model("t5", "snrspeaks/t5-one-line-summary")
|
57 |
|
58 |
|
59 |
+
@st.cache(allow_output_mutation=True,suppress_st_warning=True)
|
60 |
def classify_category():
|
61 |
tokenizer = BertTokenizer.from_pretrained("bert-base-uncased")
|
62 |
new_model = load_model("model")
|