Spaces:
Running
Running
Feature(LLMLingua): build the LLMLingua space demo
Browse files
app.py
CHANGED
|
@@ -50,7 +50,7 @@ custom_css = """
|
|
| 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
|
| 54 |
|
| 55 |
|
| 56 |
with gr.Blocks(css=custom_css) as iface:
|
|
|
|
| 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 |
|
| 55 |
|
| 56 |
with gr.Blocks(css=custom_css) as iface:
|