Spaces:
Running
Running
Change default text
Browse files
app.py
CHANGED
@@ -45,11 +45,25 @@ st.header("Context length probing")
|
|
45 |
|
46 |
model_name = st.selectbox("Model", ["distilgpt2", "gpt2", "EleutherAI/gpt-neo-125m"])
|
47 |
metric_name = st.selectbox("Metric", ["KL divergence", "Cross entropy"], index=1)
|
48 |
-
window_len = st.select_slider(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
text = st.text_area(
|
51 |
"Input text",
|
52 |
-
|
53 |
)
|
54 |
|
55 |
if metric_name == "KL divergence":
|
|
|
45 |
|
46 |
model_name = st.selectbox("Model", ["distilgpt2", "gpt2", "EleutherAI/gpt-neo-125m"])
|
47 |
metric_name = st.selectbox("Metric", ["KL divergence", "Cross entropy"], index=1)
|
48 |
+
window_len = st.select_slider(
|
49 |
+
r"Window size ($c_\text{max}$)",
|
50 |
+
options=[8, 16, 32, 64, 128, 256, 512, 1024],
|
51 |
+
value=512
|
52 |
+
)
|
53 |
+
|
54 |
+
DEFAULT_TEXT = """
|
55 |
+
We present context length probing, a novel explanation technique for causal
|
56 |
+
language models, based on tracking the predictions of a model as a function of the length of
|
57 |
+
available context, and allowing to assign differential importance scores to different contexts.
|
58 |
+
The technique is model-agnostic and does not rely on access to model internals beyond computing
|
59 |
+
token-level probabilities. We apply context length probing to large pre-trained language models
|
60 |
+
and offer some initial analyses and insights, including the potential for studying long-range
|
61 |
+
dependencies.
|
62 |
+
""".replace("\n", " ").strip()
|
63 |
|
64 |
text = st.text_area(
|
65 |
"Input text",
|
66 |
+
DEFAULT_TEXT,
|
67 |
)
|
68 |
|
69 |
if metric_name == "KL divergence":
|