Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ compressors = {
|
|
15 |
|
16 |
tokenizer = tiktoken.encoding_for_model("gpt-4")
|
17 |
|
18 |
-
def compress(original_prompt, compression_rate, base_model="xlm-roberta", force_tokens=['
|
19 |
if '\\n' in force_tokens:
|
20 |
idx = force_tokens.index('\\n')
|
21 |
force_tokens[idx] = '\n'
|
|
|
15 |
|
16 |
tokenizer = tiktoken.encoding_for_model("gpt-4")
|
17 |
|
18 |
+
def compress(original_prompt, compression_rate, base_model="xlm-roberta", force_tokens = ['. ', ', '], chunk_end_tokens=['.', '\n']):
|
19 |
if '\\n' in force_tokens:
|
20 |
idx = force_tokens.index('\\n')
|
21 |
force_tokens[idx] = '\n'
|