update processing
Browse files- processing_time_rcd.py +9 -1
processing_time_rcd.py
CHANGED
|
@@ -196,8 +196,13 @@ class TimeRCDProcessor(ProcessorMixin):
|
|
| 196 |
import os
|
| 197 |
from huggingface_hub import hf_hub_download
|
| 198 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 199 |
# Filter kwargs to only include those accepted by hf_hub_download
|
| 200 |
-
# Remove transformers-specific kwargs like 'trust_remote_code'
|
| 201 |
hf_hub_kwargs = {
|
| 202 |
k: v for k, v in kwargs.items()
|
| 203 |
if k in [
|
|
@@ -234,5 +239,8 @@ class TimeRCDProcessor(ProcessorMixin):
|
|
| 234 |
config.pop("processor_type", None)
|
| 235 |
config.pop("auto_map", None)
|
| 236 |
|
|
|
|
|
|
|
|
|
|
| 237 |
return cls(**config)
|
| 238 |
|
|
|
|
| 196 |
import os
|
| 197 |
from huggingface_hub import hf_hub_download
|
| 198 |
|
| 199 |
+
# Separate initialization kwargs from hf_hub_download kwargs
|
| 200 |
+
init_kwargs = {
|
| 201 |
+
k: v for k, v in kwargs.items()
|
| 202 |
+
if k in ['win_size', 'stride', 'normalize', 'pad_to_multiple']
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
# Filter kwargs to only include those accepted by hf_hub_download
|
|
|
|
| 206 |
hf_hub_kwargs = {
|
| 207 |
k: v for k, v in kwargs.items()
|
| 208 |
if k in [
|
|
|
|
| 239 |
config.pop("processor_type", None)
|
| 240 |
config.pop("auto_map", None)
|
| 241 |
|
| 242 |
+
# Merge loaded config with any passed init_kwargs (init_kwargs take precedence)
|
| 243 |
+
config.update(init_kwargs)
|
| 244 |
+
|
| 245 |
return cls(**config)
|
| 246 |
|