Spaces:
Runtime error
Runtime error
Create app1.py
Browse files
app1.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Load model directly
|
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")
|
10 |
+
|
11 |
+
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")
|