marcelomoreno26 commited on
Commit
0cb9394
1 Parent(s): 40da909

Update model_functions.py

Browse files
Files changed (1) hide show
  1. model_functions.py +3 -3
model_functions.py CHANGED
@@ -6,14 +6,14 @@ from peft import PeftModel, PeftConfig
6
  import streamlit as st
7
 
8
 
9
-
10
  def load_sentiment_analyzer():
11
  tokenizer = AutoTokenizer.from_pretrained("aliciiavs/sentiment-analysis-whatsapp2")
12
  model = AutoModelForSequenceClassification.from_pretrained("aliciiavs/sentiment-analysis-whatsapp2")
13
 
14
  return tokenizer, model
15
 
16
-
17
  def load_summarizer():
18
  config = PeftConfig.from_pretrained("marcelomoreno26/bart-large-samsum-adapter")
19
  model = AutoModelForSeq2SeqLM.from_pretrained("facebook/bart-large")
@@ -24,7 +24,7 @@ def load_summarizer():
24
 
25
  return tokenizer, model
26
 
27
-
28
  def load_NER():
29
  config = AutoConfig.from_pretrained("hannahisrael03/wikineural-multilingual-ner-finetuned-wikiann")
30
  model = AutoModelForTokenClassification.from_pretrained("hannahisrael03/wikineural-multilingual-ner-finetuned-wikiann",config=config)
 
6
  import streamlit as st
7
 
8
 
9
+ @st.cache_resource
10
  def load_sentiment_analyzer():
11
  tokenizer = AutoTokenizer.from_pretrained("aliciiavs/sentiment-analysis-whatsapp2")
12
  model = AutoModelForSequenceClassification.from_pretrained("aliciiavs/sentiment-analysis-whatsapp2")
13
 
14
  return tokenizer, model
15
 
16
+ @st.cache_resource
17
  def load_summarizer():
18
  config = PeftConfig.from_pretrained("marcelomoreno26/bart-large-samsum-adapter")
19
  model = AutoModelForSeq2SeqLM.from_pretrained("facebook/bart-large")
 
24
 
25
  return tokenizer, model
26
 
27
+ @st.cache_resource
28
  def load_NER():
29
  config = AutoConfig.from_pretrained("hannahisrael03/wikineural-multilingual-ner-finetuned-wikiann")
30
  model = AutoModelForTokenClassification.from_pretrained("hannahisrael03/wikineural-multilingual-ner-finetuned-wikiann",config=config)