iofu728 commited on
Commit
b7f85ba
1 Parent(s): 1452b01

Feature(LLMLingua): build the LLMLingua space demo

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import gradio as gr
2
  from llmlingua import PromptCompressor
3
 
4
- llm_lingua = PromptCompressor("gpt2", "cpu")
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=3,
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=3,
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'):