Lillian McAboy commited on
Commit
47d63ff
·
1 Parent(s): d0b1e25
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -28,8 +28,11 @@ def get_tokenizer(model_name):
28
 
29
  @st.cache(allow_output_mutation=True)
30
  def get_model(model_name):
31
- return AutoModelForSeq2SeqLM.from_pretrained(model_name)
32
-
 
 
 
33
  original_text = st.text_area("Original Document", "This is my text that I want to change.")
34
  new_text = st.text_area("New Document", help="Leave this blank, this will be updated with your new document.")
35
 
 
28
 
29
  @st.cache(allow_output_mutation=True)
30
  def get_model(model_name):
31
+ import torch
32
+ from transformers import AutoModelForCausalLM
33
+ mymodel = AutoModelForCausalLM.from_pretrained(model, device_map='auto', torch_dtype=torch.bfloat16)
34
+ print(f"Loaded model, {mymodel.num_parameters():,d} parameters.")
35
+ return mymodel
36
  original_text = st.text_area("Original Document", "This is my text that I want to change.")
37
  new_text = st.text_area("New Document", help="Leave this blank, this will be updated with your new document.")
38