SumayyaAli commited on
Commit
99ae6df
·
verified ·
1 Parent(s): 0c332ef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -23,7 +23,8 @@ checkpoint = "MBZUAI/LaMini-Flan-T5-248M"
23
  #model and tokenizer loading
24
 
25
  tokenizer = T5Tokenizer.from_pretrained(checkpoint)
26
- base_model = T5ForConditionalGeneration.from_pretrained(checkpoint, device_map='auto', torch_dtype=torch.float32)
 
27
 
28
  #file loader and preprocessing
29
  def file_preprocessing(file):
 
23
  #model and tokenizer loading
24
 
25
  tokenizer = T5Tokenizer.from_pretrained(checkpoint)
26
+ with tempfile.TemporaryDirectory() as offload_folder:
27
+ base_model = T5ForConditionalGeneration.from_pretrained(checkpoint, device_map='auto', torch_dtype=torch.float32, offload_folder=offload_folder)
28
 
29
  #file loader and preprocessing
30
  def file_preprocessing(file):