pyresearch commited on
Commit
4a40fb3
·
verified ·
1 Parent(s): 476f787

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -4,7 +4,10 @@ import torch
4
 
5
  # Load model and tokenizer
6
  tokenizer = AutoTokenizer.from_pretrained("microsoft/phi-2", trust_remote_code=True)
7
- model = AutoModelForCausalLM.from_pretrained("microsoft/phi-2", device="cpu", trust_remote_code=True)
 
 
 
8
 
9
  # Streamlit app
10
  st.title("Text Generation with Transformers")
 
4
 
5
  # Load model and tokenizer
6
  tokenizer = AutoTokenizer.from_pretrained("microsoft/phi-2", trust_remote_code=True)
7
+ model = AutoModelForCausalLM.from_pretrained("microsoft/phi-2", trust_remote_code=True)
8
+
9
+ # Move model to CPU
10
+ model.to("cpu")
11
 
12
  # Streamlit app
13
  st.title("Text Generation with Transformers")