add support for hub integration in HF space
Browse files- Created new model repo on Hugging Face: username/abuse-detector-he-en
- Configured push_to_hub to use this new repository (requires HF_TOKEN with write access)
- train_abuse_model.py +2 -2
train_abuse_model.py
CHANGED
@@ -355,8 +355,8 @@ def push_model_to_hub():
|
|
355 |
try:
|
356 |
logger.info("π Pushing model to Hugging Face Hub...")
|
357 |
tokenizer, model = load_saved_model_and_tokenizer()
|
358 |
-
model.push_to_hub("rshakked/
|
359 |
-
tokenizer.push_to_hub("rshakked/
|
360 |
return "β
Model pushed to hub successfully!"
|
361 |
except Exception as e:
|
362 |
logger.exception("β Failed to push model to hub.")
|
|
|
355 |
try:
|
356 |
logger.info("π Pushing model to Hugging Face Hub...")
|
357 |
tokenizer, model = load_saved_model_and_tokenizer()
|
358 |
+
model.push_to_hub("rshakked/abuse-detector-he-en", use_auth_token=token)
|
359 |
+
tokenizer.push_to_hub("rshakked/abuse-detector-he-en", use_auth_token=token)
|
360 |
return "β
Model pushed to hub successfully!"
|
361 |
except Exception as e:
|
362 |
logger.exception("β Failed to push model to hub.")
|