mb-rag 1.1.58__tar.gz → 1.1.60__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.

Files changed (25) hide show
  1. {mb_rag-1.1.58 → mb_rag-1.1.60}/PKG-INFO +1 -1
  2. {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/basic.py +4 -2
  3. {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/version.py +1 -1
  4. {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag.egg-info/PKG-INFO +1 -1
  5. {mb_rag-1.1.58 → mb_rag-1.1.60}/README.md +0 -0
  6. {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/__init__.py +0 -0
  7. {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/chatbot/__init__.py +0 -0
  8. {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/chatbot/chains.py +0 -0
  9. {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/chatbot/conversation.py +0 -0
  10. {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/chatbot/prompts.py +0 -0
  11. {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/rag/__init__.py +0 -0
  12. {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/rag/embeddings.py +0 -0
  13. {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/utils/__init__.py +0 -0
  14. {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/utils/all_data_extract.py +0 -0
  15. {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/utils/bounding_box.py +0 -0
  16. {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/utils/document_extract.py +0 -0
  17. {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/utils/extra.py +0 -0
  18. {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/utils/pdf_extract.py +0 -0
  19. {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag.egg-info/SOURCES.txt +0 -0
  20. {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag.egg-info/dependency_links.txt +0 -0
  21. {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag.egg-info/requires.txt +0 -0
  22. {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag.egg-info/top_level.txt +0 -0
  23. {mb_rag-1.1.58 → mb_rag-1.1.60}/pyproject.toml +0 -0
  24. {mb_rag-1.1.58 → mb_rag-1.1.60}/setup.cfg +0 -0
  25. {mb_rag-1.1.58 → mb_rag-1.1.60}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mb_rag
3
- Version: 1.1.58
3
+ Version: 1.1.60
4
4
  Summary: RAG function file
5
5
  Author: ['Malav Bateriwala']
6
6
  Requires-Python: >=3.8
@@ -2,6 +2,7 @@
2
2
 
3
3
  import os
4
4
  from langchain_core.messages import HumanMessage
5
+ import torch
5
6
  from mb_rag.utils.extra import check_package
6
7
  import base64
7
8
  from .utils.extra import check_package
@@ -41,7 +42,7 @@ class ModelFactory:
41
42
 
42
43
  self.model_type = model_type
43
44
  self.model_name = model_name
44
- model_data = creators.get(model_type)
45
+ model_data = creators[model_type] if model_type in creators else None
45
46
  if not model_data:
46
47
  raise ValueError(f"Unsupported model type: {model_type}")
47
48
 
@@ -195,7 +196,7 @@ class ModelFactory:
195
196
  from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline, AutoModelForImageTextToText,AutoProcessor
196
197
  import torch
197
198
 
198
- device = torch.device(device) if torch.cuda.is_available() else torch.device("cpu")
199
+ device = torch.device("cuda" if torch.cuda.is_available() and device == "cuda" else "cpu")
199
200
 
200
201
  temperature = kwargs.pop("temperature", 0.7)
201
202
  max_length = kwargs.pop("max_length", 1024)
@@ -301,6 +302,7 @@ class ModelFactory:
301
302
 
302
303
  df = pd.DataFrame(query_list, columns=["query"])
303
304
  df["response"] = None
305
+ df["input_data"] = None if input_data is None else input_data
304
306
 
305
307
  structured_model = None
306
308
  if pydantic_model is not None:
@@ -1,5 +1,5 @@
1
1
  MAJOR_VERSION = 1
2
2
  MINOR_VERSION = 1
3
- PATCH_VERSION = 58
3
+ PATCH_VERSION = 60
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.4
2
2
  Name: mb_rag
3
- Version: 1.1.58
3
+ Version: 1.1.60
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