sadgaj commited on
Commit
5554e3f
·
verified ·
1 Parent(s): 42c37be

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -11,6 +11,12 @@ import torch
11
  model_folder = "zjunlp/chatcell-small"
12
  tokenizer = AutoTokenizer.from_pretrained(model_folder)
13
  model = AutoModelForSeq2SeqLM.from_pretrained(model_folder)
 
 
 
 
 
 
14
  model.eval()
15
 
16
 
 
11
  model_folder = "zjunlp/chatcell-small"
12
  tokenizer = AutoTokenizer.from_pretrained(model_folder)
13
  model = AutoModelForSeq2SeqLM.from_pretrained(model_folder)
14
+ if torch.cuda.is_available():
15
+ device = torch.device("cuda")
16
+ model.to(device)
17
+ else:
18
+ device = torch.device("cpu")
19
+
20
  model.eval()
21
 
22