Corey Morris commited on
Commit
22725f7
1 Parent(s): 6b85865

added fake data and application dependencies

Browse files
Files changed (2) hide show
  1. app.py +19 -4
  2. requirements.txt +2 -0
app.py CHANGED
@@ -1,7 +1,22 @@
1
  import gradio as gr
 
 
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
 
 
 
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ import pandas as pd
3
+ import numpy as np
4
 
5
+ # Create a sample dataframe with 10 language models and 57 attributes
6
+ np.random.seed(0)
7
+ data = pd.DataFrame(np.random.rand(10, 57),
8
+ columns=[f'Attribute_{i+1}' for i in range(57)],
9
+ index=[f'Model_{i+1}' for i in range(10)])
10
 
11
+ # Let's consider the first attribute as the main one for sorting the leaderboard
12
+ data = data.sort_values('Attribute_1', ascending=False)
13
+
14
+ def show_leaderboard():
15
+ # Convert dataframe to html so that it can be displayed properly in Gradio
16
+ return data.to_html()
17
+
18
+ iface = gr.Interface(fn=show_leaderboard, inputs=[], outputs="html")
19
+
20
+ # Run the interface.
21
+ # Note: you don't need to use .launch() in Hugging Face Spaces, this is for local testing.
22
+ iface.launch()
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ pandas
2
+ numpy