JerryLiJinyi commited on
Commit
0d6d320
1 Parent(s): 06fee9d

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -17,7 +17,7 @@ def compressit(original_text, compressor1, ratio, maxlength):
17
  elif compressor1=="SCRL":
18
  compressor = PromptCompressor(type='SCRLCompressor', model_dir="models/gigaword-L8/", device="cpu", tokenizer_dir="sentence-transformers/paraphrase-distilroberta-base-v2")
19
  elif compressor1=="KiS":
20
- compressor = PromptCompressor(type='KiSCompressor', device="cuda", model_dir="philippelaban/keep_it_simple")
21
  else:
22
  compressor = PromptCompressor(type='SCCompressor', lang='en', model='gpt2', device='cpu')
23
 
@@ -39,7 +39,7 @@ demo = gr.Interface(
39
  gr.Textbox(lines=1, placeholder="Enter the max_length parameter if you are using SCRL or KiS", label="max_length", info="If you are using SCRL or KiS, fill in the parameter, if not, just ignore this.\n Hint: For SCRL, max_length should be shorter than the lenght of original prompt; For KiS, max_length should be longer than it.")
40
  ],
41
  outputs=[
42
- gr.Textbox(lines=1, info="Please note that when the text is very short, LLMLingua and LongLLMLingua will not work.")
43
  ]
44
  )
45
 
 
17
  elif compressor1=="SCRL":
18
  compressor = PromptCompressor(type='SCRLCompressor', model_dir="models/gigaword-L8/", device="cpu", tokenizer_dir="sentence-transformers/paraphrase-distilroberta-base-v2")
19
  elif compressor1=="KiS":
20
+ compressor = PromptCompressor(type='KiSCompressor', device="cpu", model_dir="philippelaban/keep_it_simple")
21
  else:
22
  compressor = PromptCompressor(type='SCCompressor', lang='en', model='gpt2', device='cpu')
23
 
 
39
  gr.Textbox(lines=1, placeholder="Enter the max_length parameter if you are using SCRL or KiS", label="max_length", info="If you are using SCRL or KiS, fill in the parameter, if not, just ignore this.\n Hint: For SCRL, max_length should be shorter than the lenght of original prompt; For KiS, max_length should be longer than it.")
40
  ],
41
  outputs=[
42
+ gr.Textbox(lines=1, info="Please wait patiently when proceeding it may take more than 2 minutes to generate since we are using CPUs for free.")
43
  ]
44
  )
45