gradio/demo/score_tracker/run.py
2022-07-25 02:18:42 +01:00

16 lines
304 B
Python

import gradio as gr
scores = []
def track_score(score):
scores.append(score)
top_scores = sorted(scores, reverse=True)[:3]
return top_scores
demo = gr.Interface(
track_score,
gr.Number(label="Score"),
gr.JSON(label="Top Scores")
)
if __name__ == "__main__":
demo.launch()