Spaces:
Running
Running
Feature(LLMLingua): build the LLMLingua space demo
Browse files
app.py
CHANGED
@@ -48,7 +48,7 @@ custom_css = """
|
|
48 |
"""
|
49 |
|
50 |
def compress_prompt(context, instruction, question, ratio, target_token):
|
51 |
-
compressed_prompt = llm_lingua.compress_prompt(context.split("\n\n"), instruction, question, ratio, target_token)
|
52 |
|
53 |
return [compressed_prompt[key] for key in ["compressed_prompt", "origin_tokens", "compressed_tokens", "ratio", "saving"]]
|
54 |
|
|
|
48 |
"""
|
49 |
|
50 |
def compress_prompt(context, instruction, question, ratio, target_token):
|
51 |
+
compressed_prompt = llm_lingua.compress_prompt(context.split("\n\n"), instruction, question, float(ratio), float(target_token))
|
52 |
|
53 |
return [compressed_prompt[key] for key in ["compressed_prompt", "origin_tokens", "compressed_tokens", "ratio", "saving"]]
|
54 |
|