DevJGraham commited on
Commit
a5b6d87
·
verified ·
1 Parent(s): abb52bb

Create README.md - Add code for uploading model and processor

Browse files
Files changed (1) hide show
  1. README.md +21 -0
README.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import BlipProcessor, BlipModel
2
+
3
+ # Load model & processor
4
+ processor = BlipProcessor.from_pretrained("Salesforce/blip-image-captioning-base")
5
+ model = BlipModel.from_pretrained("Salesforce/blip-image-captioning-base")
6
+
7
+ from huggingface_hub import notebook_login
8
+
9
+ notebook_login()
10
+
11
+ processor.save_pretrained('blip-base') # safe_serialization=True
12
+ model.save_pretrained('blip-base')
13
+
14
+ !hf repo create blip-base --repo-type model
15
+
16
+ from huggingface_hub import upload_folder
17
+
18
+ upload_folder(
19
+ repo_id='DevJGraham/blip-base',
20
+ folder_path = 'blip-base'
21
+ )