Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -266,7 +266,7 @@ with ui.navset_card_tab(id="tab"):
|
|
| 266 |
num_rows = 2 # Number of rows in the subplot grid
|
| 267 |
num_cols = len(logits) # Number of columns based on the number of selected logits
|
| 268 |
fig, axs = plt.subplots(num_rows, num_cols, figsize=(20, 10))
|
| 269 |
-
|
| 270 |
|
| 271 |
for size in model_bigness:
|
| 272 |
for loss in loss_type:
|
|
@@ -274,11 +274,16 @@ with ui.navset_card_tab(id="tab"):
|
|
| 274 |
if os.path.exists(file_name):
|
| 275 |
data = np.load(file_name, allow_pickle=True).item()
|
| 276 |
for k, logit in enumerate(logits):
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 282 |
else:
|
| 283 |
print(f"File not found: {file_name}")
|
| 284 |
|
|
|
|
| 266 |
num_rows = 2 # Number of rows in the subplot grid
|
| 267 |
num_cols = len(logits) # Number of columns based on the number of selected logits
|
| 268 |
fig, axs = plt.subplots(num_rows, num_cols, figsize=(20, 10))
|
| 269 |
+
# axs = axs.flatten() # Flatten axs to handle 1D indexing
|
| 270 |
|
| 271 |
for size in model_bigness:
|
| 272 |
for loss in loss_type:
|
|
|
|
| 274 |
if os.path.exists(file_name):
|
| 275 |
data = np.load(file_name, allow_pickle=True).item()
|
| 276 |
for k, logit in enumerate(logits):
|
| 277 |
+
if len(logits) == 1:
|
| 278 |
+
logit_index = int(logit) - 1
|
| 279 |
+
axs[0].plot(data['lm_logits_y_cumsum'][0, :, logit_index], label=f'Generated_{loss}_{size}')
|
| 280 |
+
axs[0].plot(data['shift_labels_y_cumsum'][0, :, logit_index], label=f'Expected_{loss}_{size}')
|
| 281 |
+
axs[0].set_title(f'Logit: {logit}- Single')
|
| 282 |
+
axs[0].legend()
|
| 283 |
+
axs[1].plot(data['lm_logits_y_full_cumsum'][0, :, logit_index], label=f'Generated_{loss}_{size}')
|
| 284 |
+
axs[1].plot(data['shift_labels_y_full_cumsum'][0, :, logit_index], label=f'Expected_{loss}_{size}')
|
| 285 |
+
axs[1].set_title(f'Logit: {logit} - Full')
|
| 286 |
+
axs[1].legend()
|
| 287 |
else:
|
| 288 |
print(f"File not found: {file_name}")
|
| 289 |
|