Andres37062 commited on
Commit
50cf1fb
·
verified ·
1 Parent(s): f7f48e6

Increase probability precision to 10 decimal places

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -85,7 +85,7 @@ def generate_with_token_probs(model, tokenizer, messages: List[Dict], max_new_to
85
  for token, prob in zip(top5_tokens, top5_probs_list):
86
  alternatives.append({
87
  "token": token,
88
- "probability": round(prob, 2)
89
  })
90
 
91
  # Get the actual generated token
@@ -478,7 +478,7 @@ async def root():
478
  <div class="tooltip-item">
479
  <span class="tooltip-rank">${rankLabel}:</span>
480
  <span class="tooltip-token">"${item.token}"</span>
481
- <span class="tooltip-prob">${item.probability.toFixed(2)}%</span>
482
  </div>
483
  `;
484
  });
 
85
  for token, prob in zip(top5_tokens, top5_probs_list):
86
  alternatives.append({
87
  "token": token,
88
+ "probability": round(prob, 10)
89
  })
90
 
91
  # Get the actual generated token
 
478
  <div class="tooltip-item">
479
  <span class="tooltip-rank">${rankLabel}:</span>
480
  <span class="tooltip-token">"${item.token}"</span>
481
+ <span class="tooltip-prob">${item.probability.toFixed(10)}%</span>
482
  </div>
483
  `;
484
  });