Skip to content

Commit

Permalink
importing llmlingua on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
emcf committed Mar 24, 2024
1 parent 95b93d2 commit 5fe6d18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compress.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
from typing import *
import os
from core import Chunk, SourceTypes
from llmlingua import PromptCompressor

llm_lingua = PromptCompressor(model_name="microsoft/llmlingua-2-xlm-roberta-large-meetingbank", use_llmlingua2=True)
CTAGS_LANGUAGES = {'py': "Python", 'ts': "Typescript", "tsx": "Typescript", "cpp": "C++", "c": "C"}

def compress_with_ctags(chunk: Chunk, extension: str) -> Chunk:
Expand Down Expand Up @@ -57,8 +59,6 @@ def compress_with_ctags(chunk: Chunk, extension: str) -> Chunk:
return Chunk(path=chunk.path, text=ctags_skeleton, image=chunk.image, source_type=SourceTypes.UNCOMPRESSIBLE_CODE)

def compress_chunks(chunks: List[Chunk]) -> List[Chunk]:
from llmlingua import PromptCompressor
llm_lingua = PromptCompressor(model_name="microsoft/llmlingua-2-xlm-roberta-large-meetingbank", use_llmlingua2=True)
new_chunks = []
for chunk in chunks:
new_chunk = None
Expand Down

0 comments on commit 5fe6d18

Please sign in to comment.