mb-rag 1.1.23__tar.gz → 1.1.24__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of mb-rag might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: mb_rag
3
- Version: 1.1.23
3
+ Version: 1.1.24
4
4
  Summary: RAG function file
5
5
  Author: ['Malav Bateriwala']
6
6
  Requires-Python: >=3.8
@@ -218,12 +218,12 @@ class ModelFactory:
218
218
  if not check_package("transformers"):
219
219
  raise ImportError("Transformers package not found. Please install it using: pip install transformers")
220
220
  if not check_package("langchain_huggingface"):
221
- raise ImportError("Transformers package not found. Please install it using: pip install langchain_huggingface")
221
+ raise ImportError("langchain_huggingface package not found. Please install it using: pip install langchain_huggingface")
222
222
  if not check_package("torch"):
223
223
  raise ImportError("Torch package not found. Please install it using: pip install torch")
224
224
 
225
225
  from langchain_huggingface import HuggingFacePipeline
226
- from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline, AutoModelForImageTextToText
226
+ from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline, AutoModelForImageTextToText,AutoProcessor
227
227
  import torch
228
228
 
229
229
  device = torch.device(device) if torch.cuda.is_available() else torch.device("cpu")
@@ -231,8 +231,8 @@ class ModelFactory:
231
231
  temperature = kwargs.pop("temperature", 0.7)
232
232
  max_length = kwargs.pop("max_length", 1024)
233
233
 
234
- tokenizer = AutoTokenizer.from_pretrained(model_name,trust_remote_code=True)
235
234
  if model_function == "image-text-to-text":
235
+ tokenizer = AutoProcessor.from_pretrained(model_name,trust_remote_code=True)
236
236
  model = AutoModelForImageTextToText.from_pretrained(
237
237
  model_name,
238
238
  torch_dtype=torch.float16 if device == "cuda" else torch.float32,
@@ -241,6 +241,7 @@ class ModelFactory:
241
241
  **kwargs
242
242
  )
243
243
  else:
244
+ tokenizer = AutoTokenizer.from_pretrained(model_name,trust_remote_code=True)
244
245
  model = AutoModelForCausalLM.from_pretrained(
245
246
  model_name,
246
247
  torch_dtype=torch.float16 if device == "cuda" else torch.float32,
@@ -1,5 +1,5 @@
1
1
  MAJOR_VERSION = 1
2
2
  MINOR_VERSION = 1
3
- PATCH_VERSION = 23
3
+ PATCH_VERSION = 24
4
4
  version = '{}.{}.{}'.format(MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION)
5
5
  __all__ = ['MAJOR_VERSION', 'MINOR_VERSION', 'PATCH_VERSION', 'version']
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: mb_rag
3
- Version: 1.1.23
3
+ Version: 1.1.24
4
4
  Summary: RAG function file
5
5
  Author: ['Malav Bateriwala']
6
6
  Requires-Python: >=3.8
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes