drclab commited on
Commit
3ef9f64
1 Parent(s): e7e055a

list_repo_files

Browse files
Files changed (2) hide show
  1. .gitignore +2 -1
  2. hugging_face.ipynb +21 -15
.gitignore CHANGED
@@ -1,2 +1,3 @@
1
  *.env
2
- auth*
 
 
1
  *.env
2
+ auth*
3
+ *.pyc
hugging_face.ipynb CHANGED
@@ -12,22 +12,22 @@
12
  },
13
  {
14
  "cell_type": "code",
15
- "execution_count": 18,
16
  "metadata": {},
17
  "outputs": [
18
  {
19
  "name": "stdout",
20
  "output_type": "stream",
21
  "text": [
22
- "Token will not been saved to git credential helper. Pass `add_to_git_credential=True` if you want to set the git credential as well.\n",
23
  "Token is valid.\n",
 
24
  "Your token has been saved to /home/dulunche/.cache/huggingface/token\n",
25
  "Login successful\n"
26
  ]
27
  }
28
  ],
29
  "source": [
30
- "login(token=HFW_TOKEN)"
31
  ]
32
  },
33
  {
@@ -114,24 +114,30 @@
114
  },
115
  {
116
  "cell_type": "code",
117
- "execution_count": 22,
118
  "metadata": {},
119
  "outputs": [
120
  {
121
- "ename": "TypeError",
122
- "evalue": "HfApi.repo_info() missing 1 required positional argument: 'repo_id'",
123
- "output_type": "error",
124
- "traceback": [
125
- "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
126
- "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
127
- "\u001b[1;32m/home/dulunche/GP_VAE/ChatDulun/hugging_face.ipynb Cell 7\u001b[0m in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> <a href='vscode-notebook-cell://wsl%2Bubuntu-22.04/home/dulunche/GP_VAE/ChatDulun/hugging_face.ipynb#W5sdnNjb2RlLXJlbW90ZQ%3D%3D?line=0'>1</a>\u001b[0m api\u001b[39m.\u001b[39;49mrepo_info()\n",
128
- "File \u001b[0;32m~/.local/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py:120\u001b[0m, in \u001b[0;36mvalidate_hf_hub_args.<locals>._inner_fn\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 117\u001b[0m \u001b[39mif\u001b[39;00m check_use_auth_token:\n\u001b[1;32m 118\u001b[0m kwargs \u001b[39m=\u001b[39m smoothly_deprecate_use_auth_token(fn_name\u001b[39m=\u001b[39mfn\u001b[39m.\u001b[39m\u001b[39m__name__\u001b[39m, has_token\u001b[39m=\u001b[39mhas_token, kwargs\u001b[39m=\u001b[39mkwargs)\n\u001b[0;32m--> 120\u001b[0m \u001b[39mreturn\u001b[39;00m fn(\u001b[39m*\u001b[39;49margs, \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwargs)\n",
129
- "\u001b[0;31mTypeError\u001b[0m: HfApi.repo_info() missing 1 required positional argument: 'repo_id'"
130
- ]
 
 
 
131
  }
132
  ],
133
  "source": [
134
- "api.repo_info()"
 
 
 
135
  ]
136
  }
137
  ],
 
12
  },
13
  {
14
  "cell_type": "code",
15
+ "execution_count": 23,
16
  "metadata": {},
17
  "outputs": [
18
  {
19
  "name": "stdout",
20
  "output_type": "stream",
21
  "text": [
 
22
  "Token is valid.\n",
23
+ "Your token has been saved in your configured git credential helpers (cache).\n",
24
  "Your token has been saved to /home/dulunche/.cache/huggingface/token\n",
25
  "Login successful\n"
26
  ]
27
  }
28
  ],
29
  "source": [
30
+ "login(token=HFW_TOKEN, add_to_git_credential=True)"
31
  ]
32
  },
33
  {
 
114
  },
115
  {
116
  "cell_type": "code",
117
+ "execution_count": 27,
118
  "metadata": {},
119
  "outputs": [
120
  {
121
+ "data": {
122
+ "text/plain": [
123
+ "['.gitattributes',\n",
124
+ " '.gitignore',\n",
125
+ " 'README.md',\n",
126
+ " 'app.py',\n",
127
+ " 'hugging_face.ipynb',\n",
128
+ " 'requirements.txt']"
129
+ ]
130
+ },
131
+ "execution_count": 27,
132
+ "metadata": {},
133
+ "output_type": "execute_result"
134
  }
135
  ],
136
  "source": [
137
+ "api.list_repo_files(\n",
138
+ " repo_id='drclab/ChatDulun',\n",
139
+ " repo_type='space'\n",
140
+ ")"
141
  ]
142
  }
143
  ],