Update app.py
Browse files55 unmodified lines56575859606162632 unmodified lines6667686970717255 unmodified linesnormalized_logits_array = F.softmax(torch.tensor(all_logits_array), dim=-1).numpy()transposed_logits_array = normalized_logits_array.T# Plotting the heatmapx_tick_positions = np.arange(start_index, end_index)x_tick_labels = [str(pos + 1) for pos in x_tick_positions]plt.figure(figsize=(15, 8))2 unmodified linesplt.ylabel('Token')plt.xlabel('Residue Index')plt.yticks(rotation=0)plt.xticks(x_tick_positions, x_tick_labels, rotation = 0)# Save the figure to a BytesIO objectbuf = BytesIO()55 unmodified lines56575859606162632 unmodified lines6667686970717255 unmodified linesnormalized_logits_array = F.softmax(torch.tensor(all_logits_array), dim=-1).numpy()transposed_logits_array = normalized_logits_array.T# Plotting the heatmapx_tick_positions = np.arange(start_index, end_index, 10)x_tick_labels = [str(pos + 1) for pos in x_tick_positions]plt.figure(figsize=(15, 8))2 unmodified linesplt.ylabel('Token')plt.xlabel('Residue Index')plt.yticks(rotation=0)plt.xticks(x_tick_positions - start_index, x_tick_labels, rotation=0)# Save the figure to a BytesIO objectbuf = BytesIO()
app.py+3-3