Update app.py
Browse files
app.py
CHANGED
|
@@ -85,6 +85,10 @@ initial_probs = get_initial_distribution()
|
|
| 85 |
def update_plot(temperature=1.0, top_k=8, top_p=0.9):
|
| 86 |
return adjust_distribution(temperature, top_k, top_p, initial_probs)
|
| 87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
interface = gr.Interface(
|
| 89 |
fn=update_plot,
|
| 90 |
inputs=[
|
|
@@ -92,7 +96,7 @@ interface = gr.Interface(
|
|
| 92 |
gr.Slider(0, 10, step=1, value=8, label="Top-k"),
|
| 93 |
gr.Slider(0.0, 1.0, step=0.01, value=0.9, label="Top-p"),
|
| 94 |
],
|
| 95 |
-
outputs=gr.Plot(label="Token Probability Distribution"),
|
| 96 |
live=True,
|
| 97 |
title="Explore generation parameters of LLMs",
|
| 98 |
description=description,
|
|
|
|
| 85 |
def update_plot(temperature=1.0, top_k=8, top_p=0.9):
|
| 86 |
return adjust_distribution(temperature, top_k, top_p, initial_probs)
|
| 87 |
|
| 88 |
+
# Generate an initial plot with default values
|
| 89 |
+
initial_plot = update_plot()
|
| 90 |
+
|
| 91 |
+
|
| 92 |
interface = gr.Interface(
|
| 93 |
fn=update_plot,
|
| 94 |
inputs=[
|
|
|
|
| 96 |
gr.Slider(0, 10, step=1, value=8, label="Top-k"),
|
| 97 |
gr.Slider(0.0, 1.0, step=0.01, value=0.9, label="Top-p"),
|
| 98 |
],
|
| 99 |
+
outputs=gr.Plot(value=initial_plot, label="Token Probability Distribution"),
|
| 100 |
live=True,
|
| 101 |
title="Explore generation parameters of LLMs",
|
| 102 |
description=description,
|