pyresearch commited on
Commit
c925507
·
verified ·
1 Parent(s): 9d27c6c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -12,7 +12,10 @@ prompt = st.text_area("Enter a prompt:", "this news is real pyresearch given rig
12
 
13
  # Load model and tokenizer
14
  tokenizer = AutoTokenizer.from_pretrained("microsoft/phi-2", trust_remote_code=True)
15
- model = AutoModelForCausalLM.from_pretrained("microsoft/phi-2", torch_dtype="auto", device=device, trust_remote_code=True)
 
 
 
16
 
17
  # Generate text on button click
18
  if st.button("Generate"):
 
12
 
13
  # Load model and tokenizer
14
  tokenizer = AutoTokenizer.from_pretrained("microsoft/phi-2", trust_remote_code=True)
15
+ model = AutoModelForCausalLM.from_pretrained("microsoft/phi-2", torch_dtype="auto", trust_remote_code=True)
16
+
17
+ # Move the model to the desired device
18
+ model.to(device)
19
 
20
  # Generate text on button click
21
  if st.button("Generate"):