Spaces:
Runtime error
Runtime error
Change default base model to mbert-base due to limited computation.
Browse files
app.py
CHANGED
@@ -35,7 +35,7 @@ def compress(original_prompt, compression_rate, base_model="xlm-roberta-large",
|
|
35 |
idx = force_tokens.index('\\n')
|
36 |
force_tokens[idx] = '\n'
|
37 |
|
38 |
-
compressor = compressors.get(base_model, compressors["
|
39 |
results = compressor.compress_prompt_llmlingua2(
|
40 |
original_prompt,
|
41 |
rate=compression_rate,
|
@@ -86,7 +86,7 @@ with gr.Blocks(title=title, css=css) as app: # 'YenLai/Superhuman' 'HaleyCH/Hale
|
|
86 |
compressed_prompt = gr.Textbox(value='', label="Compressed Prompt", lines=10, max_lines=10, interactive=False)
|
87 |
|
88 |
with gr.Column(scale=1):
|
89 |
-
base_model = gr.Radio(["
|
90 |
force_tokens = gr.Dropdown(['\\n', '.', '!', '?', ','],
|
91 |
label="Tokens to Preserve",
|
92 |
value=['\\n', '.', '!', '?', ','],
|
|
|
35 |
idx = force_tokens.index('\\n')
|
36 |
force_tokens[idx] = '\n'
|
37 |
|
38 |
+
compressor = compressors.get(base_model, compressors["mbert-base"])
|
39 |
results = compressor.compress_prompt_llmlingua2(
|
40 |
original_prompt,
|
41 |
rate=compression_rate,
|
|
|
86 |
compressed_prompt = gr.Textbox(value='', label="Compressed Prompt", lines=10, max_lines=10, interactive=False)
|
87 |
|
88 |
with gr.Column(scale=1):
|
89 |
+
base_model = gr.Radio(["mbert-base", "xlm-roberta-large"], label="Base Model", value="mbert-base", interactive=True)
|
90 |
force_tokens = gr.Dropdown(['\\n', '.', '!', '?', ','],
|
91 |
label="Tokens to Preserve",
|
92 |
value=['\\n', '.', '!', '?', ','],
|