File size: 714 Bytes
925ac7f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import pandas as pd
import gradio as gr
import asyncio  # Ensure asyncio is imported

from src.pricing import get_pricing_df


text_leaderboard = get_pricing_df()
llm_calc_app = gr.Blocks()
with llm_calc_app:

    leaderboard_table = gr.Dataframe(
                            value=text_leaderboard,
                            elem_id="text-leaderboard-table",
                            interactive=False,
                            visible=True,
                            height=800
                        )
    llm_calc_app.load()

# Ensure the app runs in an asyncio event loop
async def main():
    llm_calc_app.queue()
    await llm_calc_app.launch()

# Run the async main function
asyncio.run(main())