NameError: Name 'OnnxMinilm_L6_V2' ist nicht definiert, wenn versucht wird, PyInstaller zu verwendenPython

Python-Programme
Anonymous
 NameError: Name 'OnnxMinilm_L6_V2' ist nicht definiert, wenn versucht wird, PyInstaller zu verwenden

Post by Anonymous »

Ich habe also an einer Anwendung mit Python und TKinter gearbeitet, mit denen jemand eine Offline -LLM verwendet, um Fragen zu Dateien zu stellen, die sie hochladen können. Wir verwenden Langchain_Croma, um die Einbettungen zu behandeln. Ich glaube nicht, dass ich meinen Quellcode teilen kann, aber ich werde meine Importe teilen, da ich glaube

Code: Select all

import argparse
import os
import shutil
from langchain_community.document_loaders import PyPDFDirectoryLoader
from langchain_text_splitters import RecursiveCharacterTextSplitter
from langchain.schema.document import Document
from embedding import embedding_function
from langchain_community.vectorstores import Chroma
from langchain_community.document_loaders import UnstructuredMarkdownLoader
from langchain_community.document_loaders import UnstructuredWordDocumentLoader
< /code>
embedding.py Datei: < /p>
from transformers import AutoModelForCausalLM, AutoTokenizer, AutoModel
import torch
< /code>
 Main.py:
from time import sleep
import tkinter as tk
from tkinter import scrolledtext, filedialog
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
from langchain_chroma import Chroma
from langchain.prompts import PromptTemplate
from populate_database import add_documents_to_chroma, clear_database
from embedding import embedding_function
import gc
Wir verwenden zwei Modelle: The project structure is as follows:

[*]chroma (folder for the database)
[*]data (just some sample pdf's for testing)
[*]Qwen2.5-3B (LLM model folder)
[*]multilingual-e5-large (model folder for embeddings)
[*]dist (from attempted compilation)
[*]build (from attempted compilation)
[*]embedding.py
[*]Main.py
[*]populat_database.py
< /ul>
Der Befehl, den ich verwendet habe, war einfach: < /p>
pyinstaller main.py --onefile -w
< /code>
Die vollständige Fehlermeldung lautet wie folgt: < /p>
NameError: name 'ONNXMiniLM_L6_V2' is not defined

Traceback (most recent call last):
File "main.py", line 6, in
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 384, in exec_module
File "langchain_chroma\__init__.py", line 6, in
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 384, in exec_module
File "langchain_chroma\vectorstores.py", line 25, in
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 384, in exec_module
File "chromadb\__init__.py", line 3, in
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 384, in exec_module
File "chromadb\api\__init__.py", line 34, in
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 384, in exec_module
File "chromadb\api\models\Collection.py", line 3, in
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 384, in exec_module
File "chromadb\api\models\CollectionCommon.py", line 100, in
File "chromadb\api\models\CollectionCommon.py", line 112, in CollectionCommon
File "chromadb\utils\embedding_functions\__init__.py", line 57, in DefaultEmbeddingFunction
NameError: name 'ONNXMiniLM_L6_V2' is not defined
< /code>
Ich habe die Schritte hier ausprobiert: Chromadb 'OnnxMinilm_L6_V2' Einbettung nicht definiert mit PyInstaller < /p>
, aber keinen Erfolg gefunden. Jede Hilfe wäre sehr geschätzt.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post