liujch1998 commited on
Commit
ea1fca9
β€’
1 Parent(s): 06cefb6
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -28,7 +28,7 @@ class Interactive:
28
  self.tokenizer = transformers.AutoTokenizer.from_pretrained(MODEL_NAME, use_auth_token=HF_TOKEN_DOWNLOAD)
29
  if MODE == 'debug':
30
  return
31
- self.model = transformers.T5EncoderModel.from_pretrained(MODEL_NAME, use_auth_token=HF_TOKEN_DOWNLOAD, low_cpu_mem_usage=True, device_map='auto', torch_dtype='auto')
32
  self.model.D = self.model.shared.embedding_dim
33
  self.linear = torch.nn.Linear(self.model.D, 1, dtype=self.model.dtype).to(device)
34
  self.linear.weight = torch.nn.Parameter(self.model.shared.weight[32099, :].unsqueeze(0)) # (1, D)
 
28
  self.tokenizer = transformers.AutoTokenizer.from_pretrained(MODEL_NAME, use_auth_token=HF_TOKEN_DOWNLOAD)
29
  if MODE == 'debug':
30
  return
31
+ self.model = transformers.T5EncoderModel.from_pretrained(MODEL_NAME, use_auth_token=HF_TOKEN_DOWNLOAD, low_cpu_mem_usage=True, device_map='auto', torch_dtype='auto', offload_folder='offload')
32
  self.model.D = self.model.shared.embedding_dim
33
  self.linear = torch.nn.Linear(self.model.D, 1, dtype=self.model.dtype).to(device)
34
  self.linear.weight = torch.nn.Parameter(self.model.shared.weight[32099, :].unsqueeze(0)) # (1, D)