Spaces:
Running
Running
Update pages/21_NLP_Transformer.py
Browse files
pages/21_NLP_Transformer.py
CHANGED
|
@@ -22,7 +22,7 @@ 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.
|
| 26 |
def load_and_preprocess_data():
|
| 27 |
dataset = load_dataset("imdb", split="train[:1%]")
|
| 28 |
def preprocess_function(examples):
|
|
|
|
| 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_data(hash_funcs={tokenizer.__class__: id})
|
| 26 |
def load_and_preprocess_data():
|
| 27 |
dataset = load_dataset("imdb", split="train[:1%]")
|
| 28 |
def preprocess_function(examples):
|