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.
- {mb_rag-1.1.23 → mb_rag-1.1.24}/PKG-INFO +1 -1
- {mb_rag-1.1.23 → mb_rag-1.1.24}/mb_rag/chatbot/basic.py +4 -3
- {mb_rag-1.1.23 → mb_rag-1.1.24}/mb_rag/version.py +1 -1
- {mb_rag-1.1.23 → mb_rag-1.1.24}/mb_rag.egg-info/PKG-INFO +1 -1
- {mb_rag-1.1.23 → mb_rag-1.1.24}/README.md +0 -0
- {mb_rag-1.1.23 → mb_rag-1.1.24}/mb_rag/__init__.py +0 -0
- {mb_rag-1.1.23 → mb_rag-1.1.24}/mb_rag/chatbot/__init__.py +0 -0
- {mb_rag-1.1.23 → mb_rag-1.1.24}/mb_rag/chatbot/chains.py +0 -0
- {mb_rag-1.1.23 → mb_rag-1.1.24}/mb_rag/chatbot/prompts.py +0 -0
- {mb_rag-1.1.23 → mb_rag-1.1.24}/mb_rag/rag/__init__.py +0 -0
- {mb_rag-1.1.23 → mb_rag-1.1.24}/mb_rag/rag/embeddings.py +0 -0
- {mb_rag-1.1.23 → mb_rag-1.1.24}/mb_rag/utils/__init__.py +0 -0
- {mb_rag-1.1.23 → mb_rag-1.1.24}/mb_rag/utils/bounding_box.py +0 -0
- {mb_rag-1.1.23 → mb_rag-1.1.24}/mb_rag/utils/extra.py +0 -0
- {mb_rag-1.1.23 → mb_rag-1.1.24}/mb_rag.egg-info/SOURCES.txt +0 -0
- {mb_rag-1.1.23 → mb_rag-1.1.24}/mb_rag.egg-info/dependency_links.txt +0 -0
- {mb_rag-1.1.23 → mb_rag-1.1.24}/mb_rag.egg-info/requires.txt +0 -0
- {mb_rag-1.1.23 → mb_rag-1.1.24}/mb_rag.egg-info/top_level.txt +0 -0
- {mb_rag-1.1.23 → mb_rag-1.1.24}/pyproject.toml +0 -0
- {mb_rag-1.1.23 → mb_rag-1.1.24}/setup.cfg +0 -0
- {mb_rag-1.1.23 → mb_rag-1.1.24}/setup.py +0 -0
|
@@ -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("
|
|
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,
|
|
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
|