Spaces:
Sleeping
Sleeping
Update app.py
Browse filesmade the stream = True in demo and added h11 req + changed gradio version
app.py
CHANGED
|
@@ -109,6 +109,7 @@ class ModelWrapper:
|
|
| 109 |
top_p=top_p,
|
| 110 |
min_p=0,
|
| 111 |
pad_token_id=self.tokenizer.pad_token_id
|
|
|
|
| 112 |
)
|
| 113 |
output_text = self.tokenizer.decode(output_content[0], skip_special_tokens=True)
|
| 114 |
sys_prompt_text = output_text.split("Brief explanation\n</explanation>")[0]
|
|
@@ -139,6 +140,7 @@ demo = gr.Interface(
|
|
| 139 |
outputs=gr.Textbox(label="Compliance Output"),
|
| 140 |
title="DynaGuard Compliance Checker",
|
| 141 |
description="Paste your rules & transcript, then hit Submit."
|
|
|
|
| 142 |
)
|
| 143 |
|
| 144 |
if __name__ == "__main__":
|
|
|
|
| 109 |
top_p=top_p,
|
| 110 |
min_p=0,
|
| 111 |
pad_token_id=self.tokenizer.pad_token_id
|
| 112 |
+
|
| 113 |
)
|
| 114 |
output_text = self.tokenizer.decode(output_content[0], skip_special_tokens=True)
|
| 115 |
sys_prompt_text = output_text.split("Brief explanation\n</explanation>")[0]
|
|
|
|
| 140 |
outputs=gr.Textbox(label="Compliance Output"),
|
| 141 |
title="DynaGuard Compliance Checker",
|
| 142 |
description="Paste your rules & transcript, then hit Submit."
|
| 143 |
+
streaming=True
|
| 144 |
)
|
| 145 |
|
| 146 |
if __name__ == "__main__":
|