Spaces:
Running
Running
OliverPerrin
commited on
Commit
·
5f18a86
1
Parent(s):
d9dbe7c
Update Gradio demo, inference factory, and evaluation results
Browse files- scripts/delete_hf_repo.py +0 -17
- scripts/upload_model_to_hf.py +0 -32
scripts/delete_hf_repo.py
DELETED
|
@@ -1,17 +0,0 @@
|
|
| 1 |
-
"""Delete Hugging Face repository."""
|
| 2 |
-
from huggingface_hub import HfApi
|
| 3 |
-
|
| 4 |
-
# Login uses HF_TOKEN environment variable automatically
|
| 5 |
-
|
| 6 |
-
# Initialize API
|
| 7 |
-
api = HfApi()
|
| 8 |
-
|
| 9 |
-
# Delete the OliverPerrin/LexiMind model repository
|
| 10 |
-
repo_id = "OliverPerrin/LexiMind"
|
| 11 |
-
|
| 12 |
-
try:
|
| 13 |
-
print(f"Deleting model repository {repo_id}...")
|
| 14 |
-
api.delete_repo(repo_id=repo_id, repo_type="model")
|
| 15 |
-
print(f"✓ Successfully deleted {repo_id}")
|
| 16 |
-
except Exception as e:
|
| 17 |
-
print(f"Error deleting repository: {e}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scripts/upload_model_to_hf.py
DELETED
|
@@ -1,32 +0,0 @@
|
|
| 1 |
-
"""Upload model checkpoint to Hugging Face Hub."""
|
| 2 |
-
import os
|
| 3 |
-
from huggingface_hub import HfApi, create_repo
|
| 4 |
-
|
| 5 |
-
# Login uses HF_TOKEN environment variable automatically
|
| 6 |
-
|
| 7 |
-
# Initialize API
|
| 8 |
-
api = HfApi()
|
| 9 |
-
|
| 10 |
-
# Model repository
|
| 11 |
-
repo_id = "OliverPerrin/LexiMind-Model"
|
| 12 |
-
model_file = "checkpoints/best.pt"
|
| 13 |
-
|
| 14 |
-
# Create repository if it doesn't exist
|
| 15 |
-
try:
|
| 16 |
-
print(f"Creating model repository {repo_id}...")
|
| 17 |
-
create_repo(repo_id=repo_id, repo_type="model", exist_ok=True, private=False)
|
| 18 |
-
print("✓ Repository created/verified")
|
| 19 |
-
except Exception as e:
|
| 20 |
-
print(f"Repository creation: {e}")
|
| 21 |
-
|
| 22 |
-
print(f"Uploading {model_file} to {repo_id}...")
|
| 23 |
-
|
| 24 |
-
# Upload the model file
|
| 25 |
-
api.upload_file(
|
| 26 |
-
path_or_fileobj=model_file,
|
| 27 |
-
path_in_repo="best.pt",
|
| 28 |
-
repo_id=repo_id,
|
| 29 |
-
repo_type="model",
|
| 30 |
-
)
|
| 31 |
-
|
| 32 |
-
print("✓ Model uploaded successfully!")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|