File size: 512 Bytes
831e906
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import streamlit as st
def model_analytics(session_state, config):
    COST_PER_1000_TOKENS_USD = config["COST_PER_1000_TOKENS_USD"]
    
    st.markdown("# Model Analytics")

    st.write("Total tokens used :", session_state["tokens_used"])
    st.write("Speed :", session_state["tps"], "  tokens/sec")
    st.write(
        "Total cost incurred :",
        round(
            COST_PER_1000_TOKENS_USD * session_state["tokens_used"] / 1000,
            3,
        ),
        "USD",
    )

    st.markdown("---")