treelly commited on
Commit
5018253
·
1 Parent(s): a4ccca3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -8
app.py CHANGED
@@ -1,13 +1,16 @@
1
  import gradio as gr
2
 
3
- description = "Story generation with GPT-2"
4
- title = "Generate your own story"
5
- examples = [["Adventurer is approached by a mysterious stranger in the tavern for a new quest."]]
6
 
7
- interface = gr.load("huggingface/pranavpsv/gpt2-genre-story-generator",
8
- description=description,
9
- examples=examples
10
- )
11
 
12
- interface.launch()
 
 
 
 
 
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