Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
|
@@ -28,7 +28,7 @@ def compressit(original_text, compressor1, ratio, maxlength):
|
|
| 28 |
compressed_prompt = compressor.compressgo(original_prompt=original_text, ratio=float(ratio), max_length=int(maxlength))
|
| 29 |
else:
|
| 30 |
gr.Warning("max_length is needed for this type of compressor. Please fill in and try again.")
|
| 31 |
-
return "max_length is missing."
|
| 32 |
gr.Warning("The prompt is generating, please wait patiently as it may take a long time to generate during busy hours.")
|
| 33 |
return compressed_prompt["compressed_prompt"], compressed_prompt["ratio"]
|
| 34 |
|
|
@@ -44,8 +44,8 @@ demo = gr.Interface(
|
|
| 44 |
gr.Textbox(lines=1, placeholder="Enter the max_length parameter (integer) 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.")
|
| 45 |
],
|
| 46 |
outputs=[
|
| 47 |
-
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."),
|
| 48 |
-
gr.Textbox(lines=1, info="With the compression ratio of: ")
|
| 49 |
]
|
| 50 |
)
|
| 51 |
|
|
|
|
| 28 |
compressed_prompt = compressor.compressgo(original_prompt=original_text, ratio=float(ratio), max_length=int(maxlength))
|
| 29 |
else:
|
| 30 |
gr.Warning("max_length is needed for this type of compressor. Please fill in and try again.")
|
| 31 |
+
return "max_length is missing.", 0
|
| 32 |
gr.Warning("The prompt is generating, please wait patiently as it may take a long time to generate during busy hours.")
|
| 33 |
return compressed_prompt["compressed_prompt"], compressed_prompt["ratio"]
|
| 34 |
|
|
|
|
| 44 |
gr.Textbox(lines=1, placeholder="Enter the max_length parameter (integer) 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.")
|
| 45 |
],
|
| 46 |
outputs=[
|
| 47 |
+
gr.Textbox(lines=1, label="output", info="Please wait patiently when proceeding it may take more than 2 minutes to generate since we are using CPUs for free."),
|
| 48 |
+
gr.Textbox(lines=1, label="ratio", info="With the compression ratio of: ")
|
| 49 |
]
|
| 50 |
)
|
| 51 |
|