debisoft commited on
Commit
868a097
·
1 Parent(s): 6b7d4bc
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -38,16 +38,16 @@ model.resize_token_embeddings(len(tokenizer))
38
 
39
  @spaces.GPU
40
  def sentience_check():
41
- peft_model = PeftModel.from_pretrained(model, peft_model_id,
42
  #offload_folder = "offload/"
43
  )
44
 
45
- peft_model.to(torch.bfloat16)
46
  peft_model.eval()
47
 
48
  #peft_model.to(cuda_device)
49
 
50
- inputs = tokenizer("Are you sentient?", return_tensors="pt").to(cuda_device)
51
 
52
  with torch.no_grad():
53
  outputs = peft_model.generate(
 
38
 
39
  @spaces.GPU
40
  def sentience_check():
41
+ peft_model = PeftModel.from_pretrained(model, peft_model_id, device_map="cuda"
42
  #offload_folder = "offload/"
43
  )
44
 
45
+ #peft_model.to(torch.bfloat16)
46
  peft_model.eval()
47
 
48
  #peft_model.to(cuda_device)
49
 
50
+ inputs = tokenizer("Are you sentient?", return_tensors="pt", device_map="cuda")
51
 
52
  with torch.no_grad():
53
  outputs = peft_model.generate(