Eladlev / AutoPrompt

A framework for prompt tuning using Intent-based Prompt Calibration
Apache License 2.0
2.22k stars 193 forks source link

ModuleNotFoundError: No module named '_sqlite3' #102

Open shuvo881 opened 1 week ago

shuvo881 commented 1 week ago

/AutoPrompt$ python run_pipeline.py ╭───────────────────── Traceback (most recent call last) ─────────────────────╮ │ /home/shuvo/Documents/ML Project/remote/AutoPrompt/run_pipeline.py:1 in │ │ │ │ │ │ ❱ 1 from optimization_pipeline import OptimizationPipeline │ │ 2 from utils.config import load_yaml, override_config │ │ 3 import argparse │ │ 4 │ │ │ │ /home/shuvo/Documents/ML │ │ Project/remote/AutoPrompt/optimization_pipeline.py:3 in │ │ │ │ 1 import pandas as pd │ │ 2 │ │ ❱ 3 from eval.evaluator import Eval │ │ 4 from dataset.base_dataset import DatasetBase │ │ 5 from utils.llm_chain import MetaChain │ │ 6 from estimator import give_estimator │ │ │ │ /home/shuvo/Documents/ML Project/remote/AutoPrompt/eval/evaluator.py:4 in │ │ │ │ │ │ 1 import pandas as pd │ │ 2 import numpy as np │ │ 3 from sklearn.metrics import confusion_matrix │ │ ❱ 4 import eval.eval_utils as utils │ │ 5 │ │ 6 class Eval: │ │ 7 │ """ │ │ │ │ /home/shuvo/Documents/ML Project/remote/AutoPrompt/eval/eval_utils.py:1 in │ │ │ │ │ │ ❱ 1 from estimator.estimator_llm import LLMEstimator │ │ 2 │ │ 3 │ │ 4 def set_function_from_iterrow(func): │ │ │ │ /home/shuvo/Documents/ML Project/remote/AutoPrompt/estimator/init.py:3 │ │ in │ │ │ │ 1 import pandas as pd │ │ 2 │ │ ❱ 3 from .estimator_argilla import ArgillaEstimator │ │ 4 from .estimator_llm import LLMEstimator │ │ 5 from .estimator_llm_batch import LLMBatchEstimator │ │ 6 from dataset.base_dataset import DatasetBase │ │ │ │ /home/shuvo/Documents/ML │ │ Project/remote/AutoPrompt/estimator/estimator_argilla.py:6 in │ │ │ │ 3 import pandas as pd │ │ 4 from argilla.client.singleton import active_client │ │ 5 from utils.config import Color │ │ ❱ 6 from dataset.base_dataset import DatasetBase │ │ 7 import json │ │ 8 import webbrowser │ │ 9 import base64 │ │ │ │ /home/shuvo/Documents/ML │ │ Project/remote/AutoPrompt/dataset/base_dataset.py:8 in │ │ │ │ 5 from datetime import datetime │ │ 6 import csv │ │ 7 │ │ ❱ 8 from utils.dedup import Dedup │ │ 9 │ │ 10 class DatasetBase: │ │ 11 │ """ │ │ │ │ /home/shuvo/Documents/ML Project/remote/AutoPrompt/utils/dedup.py:2 in │ │ │ │ │ │ 1 import random │ │ ❱ 2 from sentence_transformers import SentenceTransformer │ │ 3 import faiss │ │ 4 import pandas as pd │ │ 5 │ │ │ │ /home/shuvo/Documents/ML │ │ Project/remote/AutoPrompt/venv/lib/python3.10/site-packages/sentence_transf │ │ ormers/init.py:3 in │ │ │ │ 1 version = "2.2.2" │ │ 2 MODEL_HUB_ORGANIZATION = 'sentence-transformers' │ │ ❱ 3 from .datasets import SentencesDataset, ParallelSentencesDataset │ │ 4 from .LoggingHandler import LoggingHandler │ │ 5 from .SentenceTransformer import SentenceTransformer │ │ 6 from .readers import InputExample │ │ │ │ /home/shuvo/Documents/ML │ │ Project/remote/AutoPrompt/venv/lib/python3.10/site-packages/sentence_transf │ │ ormers/datasets/init.py:1 in │ │ │ │ ❱ 1 from .DenoisingAutoEncoderDataset import DenoisingAutoEncoderDataset │ │ 2 from .NoDuplicatesDataLoader import NoDuplicatesDataLoader │ │ 3 from .ParallelSentencesDataset import ParallelSentencesDataset │ │ 4 from .SentencesDataset import SentencesDataset │ │ │ │ /home/shuvo/Documents/ML │ │ Project/remote/AutoPrompt/venv/lib/python3.10/site-packages/sentence_transf │ │ ormers/datasets/DenoisingAutoEncoderDataset.py:5 in │ │ │ │ 2 from typing import List │ │ 3 from ..readers.InputExample import InputExample │ │ 4 import numpy as np │ │ ❱ 5 import nltk │ │ 6 from nltk.tokenize.treebank import TreebankWordDetokenizer │ │ 7 │ │ 8 class DenoisingAutoEncoderDataset(Dataset): │ │ │ │ /home/shuvo/Documents/ML │ │ Project/remote/AutoPrompt/venv/lib/python3.10/site-packages/nltk/init.p │ │ y:153 in │ │ │ │ 150 from nltk.parse import │ │ 151 from nltk.tag import │ │ 152 from nltk.tokenize import │ │ ❱ 153 from nltk.translate import │ │ 154 from nltk.tree import │ │ 155 from nltk.sem import │ │ 156 from nltk.stem import │ │ │ │ /home/shuvo/Documents/ML │ │ Project/remote/AutoPrompt/venv/lib/python3.10/site-packages/nltk/translate/ │ │ init.py:24 in │ │ │ │ 21 from nltk.translate.ibm5 import IBMModel5 │ │ 22 from nltk.translate.bleu_score import sentence_bleu as bleu │ │ 23 from nltk.translate.ribes_score import sentence_ribes as ribes │ │ ❱ 24 from nltk.translate.meteor_score import meteor_score as meteor │ │ 25 from nltk.translate.metrics import alignment_error_rate │ │ 26 from nltk.translate.stack_decoder import StackDecoder │ │ 27 from nltk.translate.nist_score import sentence_nist as nist │ │ │ │ /home/shuvo/Documents/ML │ │ Project/remote/AutoPrompt/venv/lib/python3.10/site-packages/nltk/translate/ │ │ meteor_score.py:13 in │ │ │ │ 10 from itertools import chain, product │ │ 11 from typing import Callable, Iterable, List, Tuple │ │ 12 │ │ ❱ 13 from nltk.corpus import WordNetCorpusReader, wordnet │ │ 14 from nltk.stem.api import StemmerI │ │ 15 from nltk.stem.porter import PorterStemmer │ │ 16 │ │ │ │ /home/shuvo/Documents/ML │ │ Project/remote/AutoPrompt/venv/lib/python3.10/site-packages/nltk/corpus/i │ │ nit.py:64 in │ │ │ │ 61 │ │ 62 import re │ │ 63 │ │ ❱ 64 from nltk.corpus.reader import │ │ 65 from nltk.corpus.util import LazyCorpusLoader │ │ 66 from nltk.tokenize import RegexpTokenizer │ │ 67 │ │ │ │ /home/shuvo/Documents/ML │ │ Project/remote/AutoPrompt/venv/lib/python3.10/site-packages/nltk/corpus/rea │ │ der/init.py:106 in │ │ │ │ 103 from nltk.corpus.reader.pros_cons import │ │ 104 from nltk.corpus.reader.categorized_sents import │ │ 105 from nltk.corpus.reader.comparative_sents import │ │ ❱ 106 from nltk.corpus.reader.panlex_lite import │ │ 107 from nltk.corpus.reader.panlex_swadesh import │ │ 108 from nltk.corpus.reader.bcp47 import │ │ 109 │ │ │ │ /home/shuvo/Documents/ML │ │ Project/remote/AutoPrompt/venv/lib/python3.10/site-packages/nltk/corpus/rea │ │ der/panlex_lite.py:15 in │ │ │ │ 12 """ │ │ 13 │ │ 14 import os │ │ ❱ 15 import sqlite3 │ │ 16 │ │ 17 from nltk.corpus.reader.api import CorpusReader │ │ 18 │ │ │ │ /usr/local/lib/python3.10/sqlite3/init.py:23 in │ │ │ │ 20 # misrepresented as being the original software. │ │ 21 # 3. This notice may not be removed or altered from any source distrib │ │ 22 │ │ ❱ 23 from sqlite3.dbapi2 import │ │ 24 │ │ 25 │ │ 26 # bpo-42264: OptimizedUnicode was deprecated in Python 3.10. It's sch │ │ │ │ /usr/local/lib/python3.10/sqlite3/dbapi2.py:27 in │ │ │ │ 24 import time │ │ 25 import collections.abc │ │ 26 │ │ ❱ 27 from _sqlite3 import │ │ 28 │ │ 29 paramstyle = "qmark" │ │ 30

Eladlev commented 1 week ago

Seems like an environment issue I suggest reinstalling from scratch. In any case, this specific error is a result of a flow that is currently by default not working. So you can simply comment out the following line: https://github.com/Eladlev/AutoPrompt/blob/e67372c850b090d663934e0293fbbb0a64a5cc69/utils/dedup.py#L2