Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
3 |
import streamlit as st
|
4 |
|
5 |
-
def count_parameters(model):
|
6 |
-
print("Counting parameters of model:{")
|
7 |
return sum(p.numel() for p in model.parameters() if p.requires_grad)
|
8 |
|
9 |
m_id = st.input_text("model id", placeholder="K00B404/Merged_Beowolx-CodePro_Medusa2-14X-7B-Mistral-I-v0-2")
|
@@ -12,4 +12,4 @@ with m_id:
|
|
12 |
tokenizer = AutoTokenizer.from_pretrained(m_id)
|
13 |
model = AutoModelForCausalLM.from_pretrained(m_id)
|
14 |
|
15 |
-
st.info(f"{count_parameters(model)} parameters")
|
|
|
2 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
3 |
import streamlit as st
|
4 |
|
5 |
+
def count_parameters(model,name):
|
6 |
+
print("Counting parameters of model:{name}")
|
7 |
return sum(p.numel() for p in model.parameters() if p.requires_grad)
|
8 |
|
9 |
m_id = st.input_text("model id", placeholder="K00B404/Merged_Beowolx-CodePro_Medusa2-14X-7B-Mistral-I-v0-2")
|
|
|
12 |
tokenizer = AutoTokenizer.from_pretrained(m_id)
|
13 |
model = AutoModelForCausalLM.from_pretrained(m_id)
|
14 |
|
15 |
+
st.info(f"{count_parameters(model, m_id)} parameters")
|