Spaces:
Running
Running
Update pages/21_NLP_Transformer.py
Browse files
pages/21_NLP_Transformer.py
CHANGED
@@ -21,8 +21,8 @@ num_epochs = st.sidebar.slider("Number of Epochs", 1, 5, 3)
|
|
21 |
batch_size = st.sidebar.slider("Batch Size", 4, 32, 8)
|
22 |
learning_rate = st.sidebar.slider("Learning Rate", 1e-6, 1e-3, 5e-5, format="%.6f")
|
23 |
|
24 |
-
#
|
25 |
-
@st.cache(allow_output_mutation=True)
|
26 |
def load_and_preprocess_data():
|
27 |
dataset = load_dataset("imdb", split="train[:1%]")
|
28 |
def preprocess_function(examples):
|
|
|
21 |
batch_size = st.sidebar.slider("Batch Size", 4, 32, 8)
|
22 |
learning_rate = st.sidebar.slider("Learning Rate", 1e-6, 1e-3, 5e-5, format="%.6f")
|
23 |
|
24 |
+
# Define a custom hash function for AddedToken type
|
25 |
+
@st.cache(allow_output_mutation=True, hash_funcs={tokenizer.__class__: id})
|
26 |
def load_and_preprocess_data():
|
27 |
dataset = load_dataset("imdb", split="train[:1%]")
|
28 |
def preprocess_function(examples):
|