Spaces:
Sleeping
Sleeping
LorenzoBioinfo commited on
Commit ·
5394111
1
Parent(s): ad56619
Add gitignore files
Browse files- .gitignore +13 -1
- src/train_model.py +5 -1
.gitignore
CHANGED
|
@@ -1,4 +1,16 @@
|
|
| 1 |
env
|
| 2 |
data/raw/tweet_eval_sentiment
|
| 3 |
data/raw/youtube-comment-sentiment
|
| 4 |
-
data/processed/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
env
|
| 2 |
data/raw/tweet_eval_sentiment
|
| 3 |
data/raw/youtube-comment-sentiment
|
| 4 |
+
data/processed/
|
| 5 |
+
|
| 6 |
+
# Cache Hugging Face
|
| 7 |
+
.cache/
|
| 8 |
+
__pycache__/
|
| 9 |
+
|
| 10 |
+
# File di test e temporanei
|
| 11 |
+
*.log
|
| 12 |
+
*.pt
|
| 13 |
+
*.bin
|
| 14 |
+
*.pkl
|
| 15 |
+
*.zip
|
| 16 |
+
.huggingface/
|
src/train_model.py
CHANGED
|
@@ -74,7 +74,11 @@ def train_model(additional_data=None,sample_train_size=1000, sample_eval_size=30
|
|
| 74 |
os.makedirs(output_dir, exist_ok=True)
|
| 75 |
trainer.save_model(output_dir)
|
| 76 |
print(f"Modello salvato in: {OUTPUT_DIR}")
|
| 77 |
-
|
| 78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
if __name__ == "__main__":
|
| 80 |
train_model()
|
|
|
|
| 74 |
os.makedirs(output_dir, exist_ok=True)
|
| 75 |
trainer.save_model(output_dir)
|
| 76 |
print(f"Modello salvato in: {OUTPUT_DIR}")
|
| 77 |
+
|
| 78 |
|
| 79 |
+
if os.getenv("HF_TOKEN"):
|
| 80 |
+
print("Pushing model to Hugging Face Hub...")
|
| 81 |
+
trainer.push_to_hub("Lordemarco/SentimentAnalysis")
|
| 82 |
+
|
| 83 |
if __name__ == "__main__":
|
| 84 |
train_model()
|