SumayyaAli commited on
Commit
7de3632
1 Parent(s): 111eae5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -7,10 +7,10 @@ import torch
7
  import base64
8
  #import os
9
  #from dotenv import load_dotenv
10
- from huggingface_hub import HfApi
11
 
12
- api = HfApi()
13
- token = api.retrieve_token("secret_token") # Replace with your secret name
14
 
15
  #load_dotenv()
16
  #token = os.environ.get("HF_TOKEN")
@@ -18,11 +18,11 @@ token = api.retrieve_token("secret_token") # Replace with your secret name
18
 
19
 
20
 
21
- checkpoint = "LaMini-Flan-T5-248M"
22
  #model and tokenizer loading
23
 
24
- tokenizer = T5Tokenizer.from_pretrained(checkpoint, token=token)
25
- base_model = T5ForConditionalGeneration.from_pretrained(checkpoint, token=token, device_map='auto', torch_dtype=torch.float32, offload_folder='D:/project/offload')
26
 
27
  #file loader and preprocessing
28
  def file_preprocessing(file):
 
7
  import base64
8
  #import os
9
  #from dotenv import load_dotenv
10
+ #from huggingface_hub import HfApi
11
 
12
+ #api = HfApi()
13
+ #token = api.retrieve_token("secret_token") # Replace with your secret name
14
 
15
  #load_dotenv()
16
  #token = os.environ.get("HF_TOKEN")
 
18
 
19
 
20
 
21
+ checkpoint = "MBZUAI/LaMini-Flan-T5-248M"
22
  #model and tokenizer loading
23
 
24
+ tokenizer = T5Tokenizer.from_pretrained(checkpoint)
25
+ base_model = T5ForConditionalGeneration.from_pretrained(checkpoint, device_map='auto', torch_dtype=torch.float32, offload_folder='D:/project/offload')
26
 
27
  #file loader and preprocessing
28
  def file_preprocessing(file):