Skip to content

Commit

Permalink
Correct "login" to "log in" when used as verb (#2434)
Browse files Browse the repository at this point in the history
  • Loading branch information
DePasqualeOrg authored Jul 31, 2024
1 parent 8c928c5 commit 97d5ef6
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Files will be downloaded in a local cache folder. More details in [this guide](h

### Login

The Hugging Face Hub uses tokens to authenticate applications (see [docs](https://huggingface.co/docs/hub/security-tokens)). To login your machine, run the following CLI:
The Hugging Face Hub uses tokens to authenticate applications (see [docs](https://huggingface.co/docs/hub/security-tokens)). To log in your machine, run the following CLI:

```bash
huggingface-cli login
Expand Down
2 changes: 1 addition & 1 deletion contrib/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def user() -> str:

@pytest.fixture(autouse=True, scope="session")
def login_as_dummy_user(token: str) -> Generator:
"""Login with dummy user token."""
"""Log in with dummy user token."""
# Cannot use `monkeypatch` fixture since we want it to be "session-scoped"
old_token = os.environ["HF_TOKEN"]
os.environ["HF_TOKEN"] = token
Expand Down
2 changes: 1 addition & 1 deletion docs/source/en/guides/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ _|_|_|_| _| _| _| _|_| _| _|_| _| _| _| _| _| _|_| _|_|_|
_| _| _| _| _| _| _| _| _| _| _|_| _| _| _| _| _| _| _|
_| _| _|_| _|_|_| _|_|_| _|_|_| _| _| _|_|_| _| _| _| _|_|_| _|_|_|_|
To login, `huggingface_hub` requires a token generated from https://huggingface.co/settings/tokens .
To log in, `huggingface_hub` requires a token generated from https://huggingface.co/settings/tokens .
Token:
Add token as git credential? (Y/n)
Token is valid (permission: write).
Expand Down
4 changes: 2 additions & 2 deletions docs/source/en/guides/hf_file_system.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ The same workflow can also be used for [Dask](https://docs.dask.org/en/stable/ho

In many cases, you must be logged in with a Hugging Face account to interact with the Hub. Refer to the [Authentication](../quick-start#authentication) section of the documentation to learn more about authentication methods on the Hub.

It is also possible to login programmatically by passing your `token` as an argument to [`HfFileSystem`]:
It is also possible to log in programmatically by passing your `token` as an argument to [`HfFileSystem`]:

```python
>>> from huggingface_hub import HfFileSystem
>>> fs = HfFileSystem(token=token)
```

If you login this way, be careful not to accidentally leak the token when sharing your source code!
If you log in this way, be careful not to accidentally leak the token when sharing your source code!
2 changes: 1 addition & 1 deletion docs/source/ko/guides/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ _|_|_|_| _| _| _| _|_| _| _|_| _| _| _| _| _| _|_| _|_|_|
_| _| _| _| _| _| _| _| _| _| _|_| _| _| _| _| _| _| _|
_| _| _|_| _|_|_| _|_|_| _|_|_| _| _| _|_|_| _| _| _| _|_|_| _|_|_|_|
To login, `huggingface_hub` requires a token generated from https://huggingface.co/settings/tokens .
To log in, `huggingface_hub` requires a token generated from https://huggingface.co/settings/tokens .
Token:
Add token as git credential? (Y/n)
Token is valid (permission: write).
Expand Down
12 changes: 6 additions & 6 deletions src/huggingface_hub/_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Contains methods to login to the Hub."""
"""Contains methods to log in to the Hub."""

import os
import subprocess
Expand Down Expand Up @@ -60,7 +60,7 @@ def login(
components. If `token` is not provided, it will be prompted to the user either with
a widget (in a notebook) or via the terminal.
To login from outside of a script, one can also use `huggingface-cli login` which is
To log in from outside of a script, one can also use `huggingface-cli login` which is
a cli command that wraps [`login`].
<Tip>
Expand Down Expand Up @@ -94,7 +94,7 @@ def login(
Raises:
[`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError)
If an organization token is passed. Only personal account tokens are valid
to login.
to log in.
[`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError)
If token is invalid.
[`ImportError`](https://docs.python.org/3/library/exceptions.html#ImportError)
Expand Down Expand Up @@ -155,7 +155,7 @@ def logout() -> None:

def interpreter_login(new_session: bool = True, write_permission: bool = False) -> None:
"""
Displays a prompt to login to the HF website and store the token.
Displays a prompt to log in to the HF website and store the token.
This is equivalent to [`login`] without passing a token when not run in a notebook.
[`interpreter_login`] is useful if you want to force the use of the terminal prompt
Expand Down Expand Up @@ -185,7 +185,7 @@ def interpreter_login(new_session: bool = True, write_permission: bool = False)
)
print(" Setting a new token will erase the existing one.")

print(" To login, `huggingface_hub` requires a token generated from https://huggingface.co/settings/tokens .")
print(" To log in, `huggingface_hub` requires a token generated from https://huggingface.co/settings/tokens .")
if os.name == "nt":
print("Token can be pasted using 'Right-Click'.")
token = getpass("Enter your token (input will not be visible): ")
Expand Down Expand Up @@ -220,7 +220,7 @@ def interpreter_login(new_session: bool = True, write_permission: bool = False)

def notebook_login(new_session: bool = True, write_permission: bool = False) -> None:
"""
Displays a widget to login to the HF website and store the token.
Displays a widget to log in to the HF website and store the token.
This is equivalent to [`login`] without passing a token when run in a notebook.
[`notebook_login`] is useful if you want to force the use of the notebook widget
Expand Down

0 comments on commit 97d5ef6

Please sign in to comment.