Feature(LLMLingua): build the baseline
Browse files- app.py +1 -0
- requirements.txt +1 -1
app.py
CHANGED
@@ -52,6 +52,7 @@ custom_css = """
|
|
52 |
|
53 |
def compress_prompt(context, instruction, question, ratio, target_token):
|
54 |
context, instruction, question = context.replace("\\n", "\n"), instruction.replace("\\n", "\n"), question.replace("\\n", "\n")
|
|
|
55 |
compressed_prompt = llm_lingua.compress_prompt(context.split("\n\n"), instruction, question, float(ratio), float(target_token))
|
56 |
|
57 |
return [compressed_prompt[key] for key in ["compressed_prompt", "origin_tokens", "compressed_tokens", "ratio", "saving"]]
|
|
|
52 |
|
53 |
def compress_prompt(context, instruction, question, ratio, target_token):
|
54 |
context, instruction, question = context.replace("\\n", "\n"), instruction.replace("\\n", "\n"), question.replace("\\n", "\n")
|
55 |
+
print(context)
|
56 |
compressed_prompt = llm_lingua.compress_prompt(context.split("\n\n"), instruction, question, float(ratio), float(target_token))
|
57 |
|
58 |
return [compressed_prompt[key] for key in ["compressed_prompt", "origin_tokens", "compressed_tokens", "ratio", "saving"]]
|
requirements.txt
CHANGED
@@ -1 +1 @@
|
|
1 |
-
llmlingua==0.1.1.
|
|
|
1 |
+
llmlingua==0.1.1.dev4
|