Update app.py
Browse files
app.py
CHANGED
|
@@ -1,13 +1,16 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
|
| 4 |
-
title = "Generate your own story"
|
| 5 |
-
examples = [["Adventurer is approached by a mysterious stranger in the tavern for a new quest."]]
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
+
scores = []
|
|
|
|
|
|
|
| 4 |
|
| 5 |
+
def track_score(score):
|
| 6 |
+
scores.append(score)
|
| 7 |
+
top_scores = sorted(scores, reverse=True)[:3]
|
| 8 |
+
return top_scores
|
| 9 |
|
| 10 |
+
demo = gr.Interface(
|
| 11 |
+
track_score,
|
| 12 |
+
gr.Number(label="Score"),
|
| 13 |
+
gr.JSON(label="Top Scores")
|
| 14 |
+
)
|
| 15 |
+
demo.launch()
|
| 16 |
|