mirror of
https://github.com/ParisNeo/lollms.git
synced 2025-02-21 01:42:08 +00:00
Added some infos
This commit is contained in:
parent
ea313c783c
commit
7f84aaa35e
@ -774,7 +774,7 @@ Date: {{date}}
|
||||
self.full(output)
|
||||
|
||||
if self.model.binding_type not in [BindingType.TEXT_IMAGE, BindingType.TEXT_IMAGE_VIDEO]:
|
||||
self.step_start("Understanding image (please wait)")
|
||||
self.ShowBlockingMessage("Understanding image (please wait)")
|
||||
from PIL import Image
|
||||
img = Image.open(str(path))
|
||||
# Convert the image to RGB mode
|
||||
@ -782,16 +782,16 @@ Date: {{date}}
|
||||
output += "## image description :\n"+ self.model.interrogate_blip([img])[0]
|
||||
# output += "## image description :\n"+ self.model.qna_blip([img],"Describe this photo with details.\n")[0]
|
||||
self.full(output)
|
||||
self.step_end("Understanding image (please wait)")
|
||||
self.HideBlockingMessage("Understanding image (please wait)")
|
||||
if self.config.debug:
|
||||
ASCIIColors.yellow(output)
|
||||
else:
|
||||
self.step_start("Importing image (please wait)")
|
||||
self.step_end("Importing image (please wait)")
|
||||
self.ShowBlockingMessage("Importing image (please wait)")
|
||||
self.HideBlockingMessage("Importing image (please wait)")
|
||||
|
||||
except Exception as ex:
|
||||
trace_exception(ex)
|
||||
self.step_end("Understanding image (please wait)", False)
|
||||
self.HideBlockingMessage("Understanding image (please wait)", False)
|
||||
ASCIIColors.error("Couldn't create new message")
|
||||
self.image_files.append(path)
|
||||
ASCIIColors.info("Received image file")
|
||||
@ -809,14 +809,17 @@ Date: {{date}}
|
||||
data_visualization_method=VisualizationMethod.PCA,
|
||||
database_dict=None)
|
||||
try:
|
||||
self.ShowBlockingMessage("Addine file to vector store.\nPlease stand by")
|
||||
data = GenericDataLoader.read_file(path)
|
||||
self.vectorizer.add_document(path, data, self.config.data_vectorization_chunk_size, self.config.data_vectorization_overlap_size)
|
||||
self.vectorizer.index()
|
||||
self.HideBlockingMessage("Addine file to vector store.\nPlease stand by")
|
||||
if callback is not None:
|
||||
callback("File added successfully",MSG_TYPE.MSG_TYPE_INFO)
|
||||
return True
|
||||
except ValueError as ve:
|
||||
ASCIIColors.error(f"Unsupported file format or empty file.\nSupported formats are {GenericDataLoader.get_supported_file_types()}")
|
||||
self.HideBlockingMessage("Addine file to vector store.\nPlease stand by")
|
||||
self.InfoMessage(f"Unsupported file format or empty file.\nSupported formats are {GenericDataLoader.get_supported_file_types()}")
|
||||
return False
|
||||
def save_personality(self, package_path=None):
|
||||
"""
|
||||
|
@ -597,7 +597,7 @@ class File64BitsManager:
|
||||
import io
|
||||
import base64
|
||||
except:
|
||||
PackageManager.install_package("pillow")
|
||||
PackageManager.install_package("Pillow")
|
||||
from PIL import Image
|
||||
import io
|
||||
import base64
|
||||
@ -628,7 +628,7 @@ class File64BitsManager:
|
||||
import io
|
||||
import base64
|
||||
except:
|
||||
PackageManager.install_package("pillow")
|
||||
PackageManager.install_package("Pillow")
|
||||
from PIL import Image
|
||||
import io
|
||||
import base64
|
||||
|
Loading…
x
Reference in New Issue
Block a user