Update app.py
Browse files
app.py
CHANGED
@@ -7,8 +7,8 @@ import streamlit as st
|
|
7 |
import torch
|
8 |
|
9 |
# Define the model repository
|
10 |
-
|
11 |
-
REPO_NAME = 'schuler/experimental-JP47D21-KPhi-3-micro-4k-instruct'
|
12 |
|
13 |
# Configure the Streamlit app
|
14 |
st.set_page_config(page_title="Experimental KPhi3 Model - Currently in Training", page_icon="🤗")
|
@@ -24,7 +24,17 @@ def load_model(repo_name):
|
|
24 |
|
25 |
tokenizer, generator_conf, model = load_model(REPO_NAME)
|
26 |
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
st.markdown(f"You may ask questions such as 'What is biology?' or 'What is the human body?'*")
|
29 |
|
30 |
try:
|
|
|
7 |
import torch
|
8 |
|
9 |
# Define the model repository
|
10 |
+
REPO_NAME = 'schuler/experimental-JP47D20'
|
11 |
+
# REPO_NAME = 'schuler/experimental-JP47D21-KPhi-3-micro-4k-instruct'
|
12 |
|
13 |
# Configure the Streamlit app
|
14 |
st.set_page_config(page_title="Experimental KPhi3 Model - Currently in Training", page_icon="🤗")
|
|
|
24 |
|
25 |
tokenizer, generator_conf, model = load_model(REPO_NAME)
|
26 |
|
27 |
+
total_params = sum(p.numel() for p in model.parameters())
|
28 |
+
trainable_params = sum(p.numel() for p in model.parameters() if p.requires_grad)
|
29 |
+
embed_params = sum(p.numel() for p in model.model.embed_tokens.parameters())*2
|
30 |
+
|
31 |
+
st.markdown(f"*This chat uses the {REPO_NAME} model with {model.get_memory_footprint() / 1e6:.2f} MB memory footprint. ")
|
32 |
+
|
33 |
+
# st.markdown(f"Total number of parameters: {total_params}. ")
|
34 |
+
# st.markdown(f"Total number of trainable parameters: {trainable_params}. ")
|
35 |
+
# st.markdown(f"Total number of embed parameters: {embed_params}. ")
|
36 |
+
|
37 |
+
st.markdown(f"Total number of non embedding trainable parameters: {(trainable_params - embed_params) / 1e6:.2f } million. ")
|
38 |
st.markdown(f"You may ask questions such as 'What is biology?' or 'What is the human body?'*")
|
39 |
|
40 |
try:
|