Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
@@ -5,8 +5,8 @@ import tiktoken
|
|
5 |
|
6 |
compressors = {
|
7 |
"xlm-roberta": PromptCompressor(
|
8 |
-
|
9 |
-
model_name='qminh369/token-classification-llmlingua2-xlm-roberta-42k_merge_1_epoch',
|
10 |
use_llmlingua2=True,
|
11 |
device_map="cpu"
|
12 |
)
|
@@ -14,9 +14,6 @@ compressors = {
|
|
14 |
|
15 |
tokenizer = tiktoken.encoding_for_model("gpt-4")
|
16 |
|
17 |
-
with open('data/benchmark_33_bctn_so_lieu_5context.json', 'r') as f:
|
18 |
-
examples = json.load(f)
|
19 |
-
|
20 |
def compress(original_prompt, compression_rate, base_model="xlm-roberta", force_tokens=['\n'], chunk_end_tokens=['.', '\n']):
|
21 |
if '\\n' in force_tokens:
|
22 |
idx = force_tokens.index('\\n')
|
|
|
5 |
|
6 |
compressors = {
|
7 |
"xlm-roberta": PromptCompressor(
|
8 |
+
model_name="microsoft/llmlingua-2-xlm-roberta-large-meetingbank",
|
9 |
+
#model_name='qminh369/token-classification-llmlingua2-xlm-roberta-42k_merge_1_epoch',
|
10 |
use_llmlingua2=True,
|
11 |
device_map="cpu"
|
12 |
)
|
|
|
14 |
|
15 |
tokenizer = tiktoken.encoding_for_model("gpt-4")
|
16 |
|
|
|
|
|
|
|
17 |
def compress(original_prompt, compression_rate, base_model="xlm-roberta", force_tokens=['\n'], chunk_end_tokens=['.', '\n']):
|
18 |
if '\\n' in force_tokens:
|
19 |
idx = force_tokens.index('\\n')
|