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