Adipta commited on
Commit
68938e8
1 Parent(s): a394a1a

Update pdfchatbot.py

Browse files
Files changed (1) hide show
  1. pdfchatbot.py +3 -3
pdfchatbot.py CHANGED
@@ -66,7 +66,7 @@ class PDFChatBot:
66
  """
67
  Load embeddings from Hugging Face and set in the config file.
68
  """
69
- self.embeddings = HuggingFaceEmbeddings(model_name=MODEL_CONFIG.MODEL_EMBEDDINGS)
70
 
71
  def load_vectordb(self):
72
  """
@@ -86,7 +86,7 @@ class PDFChatBot:
86
  """
87
  Load the tokenizer from Hugging Face and set in the config file.
88
  """
89
- self.tokenizer = AutoTokenizer.from_pretrained(MODEL_CONFIG.AUTO_TOKENIZER)
90
 
91
  def load_model(self):
92
  """
@@ -96,7 +96,7 @@ class PDFChatBot:
96
  MODEL_CONFIG.MODEL_LLM,
97
  device_map='auto',
98
  torch_dtype=torch.float32,
99
- token=True,
100
  load_in_8bit=False
101
  )
102
 
 
66
  """
67
  Load embeddings from Hugging Face and set in the config file.
68
  """
69
+ self.embeddings = HuggingFaceEmbeddings(model_name=MODEL_CONFIG.MODEL_EMBEDDINGS, token=os.getenv("HUGGINGFACE_API_TOKEN"))
70
 
71
  def load_vectordb(self):
72
  """
 
86
  """
87
  Load the tokenizer from Hugging Face and set in the config file.
88
  """
89
+ self.tokenizer = AutoTokenizer.from_pretrained(MODEL_CONFIG.AUTO_TOKENIZER, token=os.getenv("HUGGINGFACE_API_TOKEN"))
90
 
91
  def load_model(self):
92
  """
 
96
  MODEL_CONFIG.MODEL_LLM,
97
  device_map='auto',
98
  torch_dtype=torch.float32,
99
+ token=os.getenv("HUGGINGFACE_API_TOKEN"),
100
  load_in_8bit=False
101
  )
102