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.
- {mb_rag-1.1.58 → mb_rag-1.1.60}/PKG-INFO +1 -1
- {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/basic.py +4 -2
- {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/version.py +1 -1
- {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag.egg-info/PKG-INFO +1 -1
- {mb_rag-1.1.58 → mb_rag-1.1.60}/README.md +0 -0
- {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/__init__.py +0 -0
- {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/chatbot/__init__.py +0 -0
- {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/chatbot/chains.py +0 -0
- {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/chatbot/conversation.py +0 -0
- {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/chatbot/prompts.py +0 -0
- {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/rag/__init__.py +0 -0
- {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/rag/embeddings.py +0 -0
- {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/utils/__init__.py +0 -0
- {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/utils/all_data_extract.py +0 -0
- {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/utils/bounding_box.py +0 -0
- {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/utils/document_extract.py +0 -0
- {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/utils/extra.py +0 -0
- {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag/utils/pdf_extract.py +0 -0
- {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag.egg-info/SOURCES.txt +0 -0
- {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag.egg-info/dependency_links.txt +0 -0
- {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag.egg-info/requires.txt +0 -0
- {mb_rag-1.1.58 → mb_rag-1.1.60}/mb_rag.egg-info/top_level.txt +0 -0
- {mb_rag-1.1.58 → mb_rag-1.1.60}/pyproject.toml +0 -0
- {mb_rag-1.1.58 → mb_rag-1.1.60}/setup.cfg +0 -0
- {mb_rag-1.1.58 → mb_rag-1.1.60}/setup.py +0 -0
|
@@ -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
|
|
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(
|
|
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:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|