Spaces:
Runtime error
Runtime error
SumayyaAli
commited on
Update app.py
Browse files
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 |
-
|
|
|
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):
|