Spaces:
Sleeping
Sleeping
cornzz
commited on
Commit
·
8f6f070
1
Parent(s):
d0c0c2f
First llmlingua2 test on mac
Browse files
test.py
CHANGED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from llmlingua import PromptCompressor
|
2 |
+
|
3 |
+
llm_lingua = PromptCompressor(
|
4 |
+
model_name="microsoft/llmlingua-2-xlm-roberta-large-meetingbank",
|
5 |
+
use_llmlingua2=True,
|
6 |
+
device_map="mps"
|
7 |
+
)
|
8 |
+
compressed_prompt = llm_lingua.compress_prompt("The meeting was scheduled for 2:30 PM, but it started at 3:00 PM. Why?", rate=0.5)
|
9 |
+
|
10 |
+
print(compressed_prompt)
|