badguycity2 commited on
Commit
865f565
·
verified ·
1 Parent(s): 6095dc7

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +27 -0
README.md CHANGED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from huggingface_hub import HfApi
2
+
3
+ # Instantiate HfApi
4
+ api = HfApi()
5
+
6
+ # Define the name of the repository (replace with your actual repository name)
7
+ repo_id = "badguycity2/wordpress-buddy" # Make sure this is your correct repo ID
8
+
9
+ # Define the local path to your model card file (assuming it's named README.md in the current directory)
10
+ # If your model card is in a different location or has a different name, update this path.
11
+ model_card_path = "README.md" # Or the actual path to your model card file
12
+
13
+ # Define the path where the model card will be saved in the repository
14
+ repo_file_path = "README.md"
15
+
16
+ # Upload the model card file
17
+ try:
18
+ api.upload_file(
19
+ path_or_fileobj=model_card_path,
20
+ path_in_repo=repo_file_path,
21
+ repo_id=repo_id,
22
+ commit_message="Add model card"
23
+ )
24
+ print(f"Successfully uploaded {model_card_path} to {repo_id}/{repo_file_path}")
25
+ except Exception as e:
26
+ print(f"Failed to upload {model_card_path} to {repo_id}: {e}")
27
+ print("Please ensure the repository exists and you have write access.")