Spaces:
Sleeping
Sleeping
Sync from GitHub
Browse files- src/interface.py +5 -0
- src/prompts.py +9 -0
src/interface.py
CHANGED
|
@@ -4,6 +4,7 @@ from gradio import Blocks, Button, Dropdown, Examples, Markdown, Row, State, Tex
|
|
| 4 |
from gradio import Textbox
|
| 5 |
|
| 6 |
from .examples import example_dict
|
|
|
|
| 7 |
|
| 8 |
|
| 9 |
def _compile_extension():
|
|
@@ -80,4 +81,8 @@ def get_interface(optimize_function, compile_stage=False,
|
|
| 80 |
inputs=[usage_code, compile_path_st],
|
| 81 |
outputs=[test_out])
|
| 82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
return ui
|
|
|
|
| 4 |
from gradio import Textbox
|
| 5 |
|
| 6 |
from .examples import example_dict
|
| 7 |
+
from .prompts import footer_disclaimer
|
| 8 |
|
| 9 |
|
| 10 |
def _compile_extension():
|
|
|
|
| 81 |
inputs=[usage_code, compile_path_st],
|
| 82 |
outputs=[test_out])
|
| 83 |
|
| 84 |
+
# Footer with disclaimer.
|
| 85 |
+
with ui:
|
| 86 |
+
Markdown(footer_disclaimer, elem_id="footer-disclaimer")
|
| 87 |
+
|
| 88 |
return ui
|
src/prompts.py
CHANGED
|
@@ -66,6 +66,15 @@ Here is the Python code to reimplement:
|
|
| 66 |
{python_code}
|
| 67 |
"""
|
| 68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
|
| 70 |
# Define function to create the messages for the LLM.
|
| 71 |
def messages_for(python_code, module_name, schema, platform, compile_path):
|
|
|
|
| 66 |
{python_code}
|
| 67 |
"""
|
| 68 |
|
| 69 |
+
# Define a footer disclaimer to be included in the interface.
|
| 70 |
+
footer_disclaimer = """
|
| 71 |
+
<div style='text-align: center; font-size: small;'>
|
| 72 |
+
This chatbot is powered by generative AI technology.<br>
|
| 73 |
+
While it strives to provide accurate information, it may occasionally make mistakes.
|
| 74 |
+
Additionally, conversations and source codes may be used to improve AI models.
|
| 75 |
+
</div>
|
| 76 |
+
"""
|
| 77 |
+
|
| 78 |
|
| 79 |
# Define function to create the messages for the LLM.
|
| 80 |
def messages_for(python_code, module_name, schema, platform, compile_path):
|