genregod commited on
Commit
fc21379
1 Parent(s): 9931ce1

Update app.py

Browse files

Updated deprecated syntax to current

Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -3,14 +3,14 @@ import streamlit as st
3
  from transformers import AutoTokenizer, AutoModelForCausalLM
4
  from transformers import pipeline
5
 
6
- @st.cache(allow_output_mutation=True)
7
  def load_model():
8
  model_ckpt = "flax-community/gpt2-rap-lyric-generator"
9
  tokenizer = AutoTokenizer.from_pretrained(model_ckpt,from_flax=True)
10
  model = AutoModelForCausalLM.from_pretrained(model_ckpt,from_flax=True)
11
  return tokenizer, model
12
 
13
- @st.cache()
14
  def load_rappers():
15
  text_file = open("rappers.txt")
16
  rappers = text_file.readlines()
 
3
  from transformers import AutoTokenizer, AutoModelForCausalLM
4
  from transformers import pipeline
5
 
6
+ @st.cache_data(allow_output_mutation=True)
7
  def load_model():
8
  model_ckpt = "flax-community/gpt2-rap-lyric-generator"
9
  tokenizer = AutoTokenizer.from_pretrained(model_ckpt,from_flax=True)
10
  model = AutoModelForCausalLM.from_pretrained(model_ckpt,from_flax=True)
11
  return tokenizer, model
12
 
13
+ @st.cache_data()
14
  def load_rappers():
15
  text_file = open("rappers.txt")
16
  rappers = text_file.readlines()