Spaces:
Running
Running
Feature(LLMLingua): build the LLMLingua space demo
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from llmlingua import PromptCompressor
|
| 3 |
|
| 4 |
-
llm_lingua = PromptCompressor("
|
| 5 |
|
| 6 |
INTRO = """
|
| 7 |
# LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Models
|
|
@@ -61,7 +61,7 @@ with gr.Blocks(css=custom_css) as iface:
|
|
| 61 |
with gr.Tab('Prompts'):
|
| 62 |
instruction = gr.Textbox(
|
| 63 |
label="Instruction",
|
| 64 |
-
lines=
|
| 65 |
value="",
|
| 66 |
)
|
| 67 |
context = gr.Textbox(
|
|
@@ -71,7 +71,7 @@ with gr.Blocks(css=custom_css) as iface:
|
|
| 71 |
)
|
| 72 |
question = gr.Textbox(
|
| 73 |
label="Question",
|
| 74 |
-
lines=
|
| 75 |
value="",
|
| 76 |
)
|
| 77 |
with gr.Tab('Compression Target'):
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from llmlingua import PromptCompressor
|
| 3 |
|
| 4 |
+
llm_lingua = PromptCompressor(device_map="cpu")
|
| 5 |
|
| 6 |
INTRO = """
|
| 7 |
# LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Models
|
|
|
|
| 61 |
with gr.Tab('Prompts'):
|
| 62 |
instruction = gr.Textbox(
|
| 63 |
label="Instruction",
|
| 64 |
+
lines=1,
|
| 65 |
value="",
|
| 66 |
)
|
| 67 |
context = gr.Textbox(
|
|
|
|
| 71 |
)
|
| 72 |
question = gr.Textbox(
|
| 73 |
label="Question",
|
| 74 |
+
lines=1,
|
| 75 |
value="",
|
| 76 |
)
|
| 77 |
with gr.Tab('Compression Target'):
|