tokenshrink 0.2.2__py3-none-any.whl → 0.2.3__py3-none-any.whl
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.
- tokenshrink/__init__.py +1 -1
- tokenshrink/cli.py +3 -1
- tokenshrink/pipeline.py +1 -1
- {tokenshrink-0.2.2.dist-info → tokenshrink-0.2.3.dist-info}/METADATA +1 -1
- tokenshrink-0.2.3.dist-info/RECORD +9 -0
- tokenshrink-0.2.2.dist-info/RECORD +0 -9
- {tokenshrink-0.2.2.dist-info → tokenshrink-0.2.3.dist-info}/WHEEL +0 -0
- {tokenshrink-0.2.2.dist-info → tokenshrink-0.2.3.dist-info}/entry_points.txt +0 -0
- {tokenshrink-0.2.2.dist-info → tokenshrink-0.2.3.dist-info}/licenses/LICENSE +0 -0
tokenshrink/__init__.py
CHANGED
tokenshrink/cli.py
CHANGED
|
@@ -128,11 +128,13 @@ def main():
|
|
|
128
128
|
import os, logging, warnings
|
|
129
129
|
os.environ["TRANSFORMERS_VERBOSITY"] = "error"
|
|
130
130
|
os.environ["HF_HUB_DISABLE_PROGRESS_BARS"] = "1"
|
|
131
|
+
os.environ["HF_HUB_DISABLE_TELEMETRY"] = "1"
|
|
131
132
|
os.environ["TOKENIZERS_PARALLELISM"] = "false"
|
|
133
|
+
os.environ["TQDM_DISABLE"] = "1"
|
|
132
134
|
logging.getLogger("sentence_transformers").setLevel(logging.ERROR)
|
|
133
135
|
logging.getLogger("transformers").setLevel(logging.ERROR)
|
|
134
136
|
logging.getLogger("huggingface_hub").setLevel(logging.ERROR)
|
|
135
|
-
warnings.filterwarnings("ignore"
|
|
137
|
+
warnings.filterwarnings("ignore") # suppress all warnings in quiet mode
|
|
136
138
|
|
|
137
139
|
# Lazy import to avoid loading ML models for --help/--version
|
|
138
140
|
from tokenshrink import TokenShrink
|
tokenshrink/pipeline.py
CHANGED
|
@@ -613,7 +613,7 @@ class TokenShrink:
|
|
|
613
613
|
"ratio": total_compressed / total_original if total_original else 1.0,
|
|
614
614
|
}
|
|
615
615
|
|
|
616
|
-
def search(self, question: str, k: int = 5, min_score: float = 0.
|
|
616
|
+
def search(self, question: str, k: int = 5, min_score: float = 0.05) -> list[dict]:
|
|
617
617
|
"""Search without compression. Returns raw chunks with scores."""
|
|
618
618
|
if self._index.ntotal == 0:
|
|
619
619
|
return []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tokenshrink
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: Cut your AI costs 50-80%. FAISS retrieval + LLMLingua compression + REFRAG-inspired adaptive optimization.
|
|
5
5
|
Project-URL: Homepage, https://tokenshrink.dev
|
|
6
6
|
Project-URL: Repository, https://github.com/MusashiMiyamoto1-cloud/tokenshrink
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
tokenshrink/__init__.py,sha256=WDf1Ky89FcO2cC08JT_7mhM94cuLAA8Ted3ZSNna7Rk,1195
|
|
2
|
+
tokenshrink/__main__.py,sha256=yEx25Vj4itzYPdLxHsJP3MVjKM75CGdP97WIETxGljQ,91
|
|
3
|
+
tokenshrink/cli.py,sha256=qNLcOur-iYE2GBNyD6LhAS0g-eR9u4pnqdkCbBjekyE,9160
|
|
4
|
+
tokenshrink/pipeline.py,sha256=AUVd_j4Hg6_VON4TpuZJkQg_BPps1ipqm6zgYpMdttQ,24056
|
|
5
|
+
tokenshrink-0.2.3.dist-info/METADATA,sha256=NvtwCG8qlJKjtYY9Z_I1mdrIjsNHMANb05ikCszVMkc,10615
|
|
6
|
+
tokenshrink-0.2.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
7
|
+
tokenshrink-0.2.3.dist-info/entry_points.txt,sha256=vwr3PMC25J8f-ppDVngO3MmXuY_cdR2rNM_syUmT7lc,53
|
|
8
|
+
tokenshrink-0.2.3.dist-info/licenses/LICENSE,sha256=LsUNAvKJnhwbhmOWCjLq-Zf0HllrifthQ9TZkv1UUig,1064
|
|
9
|
+
tokenshrink-0.2.3.dist-info/RECORD,,
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
tokenshrink/__init__.py,sha256=ve3m9BZp1ti-U76YWmI63vPU8_C2wx8ZckJTr2Quh70,1195
|
|
2
|
-
tokenshrink/__main__.py,sha256=yEx25Vj4itzYPdLxHsJP3MVjKM75CGdP97WIETxGljQ,91
|
|
3
|
-
tokenshrink/cli.py,sha256=5F6YB_ZLPyf77AsDKKz0IPLsmgbSt0ivAsElzB6yKqU,9058
|
|
4
|
-
tokenshrink/pipeline.py,sha256=ayFJVr_esO-L0Z0JWerLcYuf83te5umAEJ6e6l-TDns,24056
|
|
5
|
-
tokenshrink-0.2.2.dist-info/METADATA,sha256=cbm_6-wOyuCd7D42wNO1NWDtJpZJka4ARSw2lMHwrlo,10615
|
|
6
|
-
tokenshrink-0.2.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
7
|
-
tokenshrink-0.2.2.dist-info/entry_points.txt,sha256=vwr3PMC25J8f-ppDVngO3MmXuY_cdR2rNM_syUmT7lc,53
|
|
8
|
-
tokenshrink-0.2.2.dist-info/licenses/LICENSE,sha256=LsUNAvKJnhwbhmOWCjLq-Zf0HllrifthQ9TZkv1UUig,1064
|
|
9
|
-
tokenshrink-0.2.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|