Update app.py
Browse files
app.py
CHANGED
@@ -111,10 +111,15 @@ def respond(
|
|
111 |
"""
|
112 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
113 |
"""
|
|
|
|
|
|
|
|
|
114 |
cpu_usage = psutil.cpu_percent(interval=1)
|
115 |
status_text = \
|
116 |
f"This chat uses the {REPO_NAME} model with {model.get_memory_footprint() / 1e6:.2f} MB memory footprint. " + \
|
117 |
-
f"Current CPU usage is {cpu_usage:.2f}% .'" + \
|
|
|
118 |
f"You may ask questions such as 'What is biology?' or 'What is the human body?'"
|
119 |
|
120 |
# """
|
|
|
111 |
"""
|
112 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
113 |
"""
|
114 |
+
total_params = sum(p.numel() for p in model.parameters())
|
115 |
+
trainable_params = sum(p.numel() for p in model.parameters() if p.requires_grad)
|
116 |
+
embed_params = sum(p.numel() for p in model.model.embed_tokens.parameters())*2
|
117 |
+
non_embed_params = (trainable_params - embed_params) / 1e6
|
118 |
cpu_usage = psutil.cpu_percent(interval=1)
|
119 |
status_text = \
|
120 |
f"This chat uses the {REPO_NAME} model with {model.get_memory_footprint() / 1e6:.2f} MB memory footprint. " + \
|
121 |
+
f"Current CPU usage is {cpu_usage:.2f}% . '" + \
|
122 |
+
f"Total number of non embedding trainable parameters: {non_embed_params:.2f} million. " + \
|
123 |
f"You may ask questions such as 'What is biology?' or 'What is the human body?'"
|
124 |
|
125 |
# """
|