Spaces:
Running
Running
Decrease limit
Browse files
app.py
CHANGED
@@ -57,8 +57,8 @@ metric_name = st.selectbox("Metric", ["KL divergence", "Cross entropy"], index=1
|
|
57 |
|
58 |
tokenizer = st.cache_resource(AutoTokenizer.from_pretrained, show_spinner=False)(model_name, use_fast=False)
|
59 |
|
60 |
-
# Make sure the logprobs do not use up more than ~
|
61 |
-
MAX_MEM =
|
62 |
# Select window lengths such that we are allowed to fill the whole window without running out of memory
|
63 |
# (otherwise the window length is irrelevant)
|
64 |
window_len_options = [
|
|
|
57 |
|
58 |
tokenizer = st.cache_resource(AutoTokenizer.from_pretrained, show_spinner=False)(model_name, use_fast=False)
|
59 |
|
60 |
+
# Make sure the logprobs do not use up more than ~4 GB of memory
|
61 |
+
MAX_MEM = 4e9 / (torch.finfo(torch.float16).bits / 8)
|
62 |
# Select window lengths such that we are allowed to fill the whole window without running out of memory
|
63 |
# (otherwise the window length is irrelevant)
|
64 |
window_len_options = [
|