Upload 1.py with huggingface_hub

#1
by tomjam - opened
Files changed (1) hide show
  1. 1.py +12 -0
1.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # huggingface-cli login. Enter "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" and press return OR
2
+ # The `notebook_login` function can only be used in a notebook (Jupyter or Colab)
3
+ # from huggingface_hub import HfApi
4
+ # from huggingface_hub import notebook_login # notebook_login()
5
+ from huggingface_hub import HfApi
6
+ api = HfApi()
7
+ # api.create_repo(repo_id="super-cool-model2", private=True)
8
+ api = HfApi()
9
+ api.upload_file(path_or_fileobj="./1.py",
10
+ path_in_repo="1.py",
11
+ repo_id="lysandre/test-model",
12
+ )