Spaces:
Running
Running
Update Gradio_UI.py
Browse files- Gradio_UI.py +23 -20
Gradio_UI.py
CHANGED
@@ -25,6 +25,27 @@ from smolagents.memory import MemoryStep
|
|
25 |
from smolagents.utils import _is_package_available
|
26 |
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
def pull_messages_from_step(
|
29 |
step_log: MemoryStep,
|
30 |
):
|
@@ -274,21 +295,7 @@ class GradioUI:
|
|
274 |
}
|
275 |
"""
|
276 |
) as demo:
|
277 |
-
|
278 |
-
"""
|
279 |
-
# Content Agent
|
280 |
-
|
281 |
-
|
282 |
-
Use content agent to determine whether language is polite by classifying text strings.
|
283 |
-
|
284 |
-
|
285 |
-
* Checks text and classify whether or not it is polite, somewhat polite, neutral, and impolite.
|
286 |
-
<pre> </pre>Uses Intel's [[Polite Guard]](https://community.intel.com/t5/Blogs/Tech-Innovation/Artificial-Intelligence-AI/Introducing-Intel-s-new-NLP-model-Polite-Guard/post/1664135) Natural Language Processing (NLP) library.
|
287 |
-
|
288 |
-
* Returns the current time if provided with a timezone.
|
289 |
-
|
290 |
-
|
291 |
-
"""
|
292 |
)
|
293 |
stored_messages = gr.State([])
|
294 |
file_uploads_log = gr.State([])
|
@@ -317,11 +324,7 @@ class GradioUI:
|
|
317 |
[text_input, file_uploads_log],
|
318 |
[stored_messages, text_input],
|
319 |
).then(self.interact_with_agent, [stored_messages, chatbot], [chatbot])
|
320 |
-
gr.Markdown(
|
321 |
-
"""
|
322 |
-
Thanks for trying it out!
|
323 |
-
"""
|
324 |
-
)
|
325 |
|
326 |
demo.launch(debug=True, share=True, **kwargs)
|
327 |
|
|
|
25 |
from smolagents.utils import _is_package_available
|
26 |
|
27 |
|
28 |
+
agent_header = """
|
29 |
+
# Content Agent
|
30 |
+
|
31 |
+
|
32 |
+
Use content agent to determine whether language is polite by passing it text strings.
|
33 |
+
|
34 |
+
|
35 |
+
* Checks text and classify whether or not it is polite, somewhat polite, neutral, and impolite.
|
36 |
+
* Uses Intel's Polite Guard NLP library
|
37 |
+
* Returns the current time if provided with a timezone.
|
38 |
+
|
39 |
+
|
40 |
+
"""
|
41 |
+
|
42 |
+
|
43 |
+
section_header = "Section Overview"
|
44 |
+
|
45 |
+
agent_footer = """
|
46 |
+
Thanks for trying it out!
|
47 |
+
""""
|
48 |
+
|
49 |
def pull_messages_from_step(
|
50 |
step_log: MemoryStep,
|
51 |
):
|
|
|
295 |
}
|
296 |
"""
|
297 |
) as demo:
|
298 |
+
gr.Markdown(agent_header)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
299 |
)
|
300 |
stored_messages = gr.State([])
|
301 |
file_uploads_log = gr.State([])
|
|
|
324 |
[text_input, file_uploads_log],
|
325 |
[stored_messages, text_input],
|
326 |
).then(self.interact_with_agent, [stored_messages, chatbot], [chatbot])
|
327 |
+
gr.Markdown( agent_footer )
|
|
|
|
|
|
|
|
|
328 |
|
329 |
demo.launch(debug=True, share=True, **kwargs)
|
330 |
|