Spaces:
Runtime error
Runtime error
Download components/sidebar_components/model_analytics.py from trhacknon/NCTC_OSINT: direct link, hf CLI and curl.
- Browser
- Download file 512 Bytes
-
https://huggingface.co/spaces/trhacknon/NCTC_OSINT/resolve/main/components/sidebar_components/model_analytics.py
- Command line
-
hf download hf://spaces/trhacknon/NCTC_OSINT/components/sidebar_components/model_analytics.py
-
curl -L -o model_analytics.py https://huggingface.co/spaces/trhacknon/NCTC_OSINT/resolve/main/components/sidebar_components/model_analytics.py
512 Bytes
| 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("---") |