Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
derek-thomas
commited on
Commit
·
80a2042
1
Parent(s):
6a9c17d
Adding execute button
Browse files
app.py
CHANGED
|
@@ -8,6 +8,7 @@ from src.envs import REFRESH_RATE, REPO_ID, QUEUE_REPO, RESULTS_REPO
|
|
| 8 |
from src.logging import setup_logger
|
| 9 |
|
| 10 |
logging.basicConfig(level=logging.INFO)
|
|
|
|
| 11 |
|
| 12 |
|
| 13 |
intro_md = f"""
|
|
@@ -25,11 +26,19 @@ This is just a visual for the auto evaluator.
|
|
| 25 |
Note that the lines of the log visual are reversed.
|
| 26 |
"""
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
with gr.Blocks(js=dark_mode_gradio_js) as demo:
|
| 29 |
with gr.Tab("Application"):
|
| 30 |
gr.Markdown(intro_md)
|
| 31 |
output = gr.HTML(log_file_to_html_string, every=1)
|
| 32 |
dummy = gr.Markdown(run_auto_eval, every=REFRESH_RATE, visible=False)
|
| 33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
if __name__ == '__main__':
|
| 35 |
demo.queue(default_concurrency_limit=40).launch(server_name="0.0.0.0", show_error=True, server_port=7860)
|
|
|
|
| 8 |
from src.logging import setup_logger
|
| 9 |
|
| 10 |
logging.basicConfig(level=logging.INFO)
|
| 11 |
+
logger = setup_logger(__name__)
|
| 12 |
|
| 13 |
|
| 14 |
intro_md = f"""
|
|
|
|
| 26 |
Note that the lines of the log visual are reversed.
|
| 27 |
"""
|
| 28 |
|
| 29 |
+
def button_auto_eval():
|
| 30 |
+
logger.info("Manually triggering Auto Eval")
|
| 31 |
+
run_auto_eval()
|
| 32 |
+
|
| 33 |
with gr.Blocks(js=dark_mode_gradio_js) as demo:
|
| 34 |
with gr.Tab("Application"):
|
| 35 |
gr.Markdown(intro_md)
|
| 36 |
output = gr.HTML(log_file_to_html_string, every=1)
|
| 37 |
dummy = gr.Markdown(run_auto_eval, every=REFRESH_RATE, visible=False)
|
| 38 |
|
| 39 |
+
# Add a button that when pressed, triggers run_auto_eval
|
| 40 |
+
button = gr.Button("Manually Run Evaluation")
|
| 41 |
+
button.click(fn=button_auto_eval, inputs=[], outputs=[])
|
| 42 |
+
|
| 43 |
if __name__ == '__main__':
|
| 44 |
demo.queue(default_concurrency_limit=40).launch(server_name="0.0.0.0", show_error=True, server_port=7860)
|