Hi,
Thanks for the suggestion. I tried restarting the kernel but it still doesn’t seem to work.
There’s another error in the following code snippet for text generation
Use a pipeline as a high-level helper
from transformers import pipeline
messages = [
{“role”: “user”, “content”: “Who are you?”},
]
pipe = pipeline(“text-generation”, model=“meta-llama/Meta-Llama-3.1-8B-Instruct”)
pipe(messages)
I still get errors like
HTTPError Traceback (most recent call last)
/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_errors.py in hf_raise_for_status(response, endpoint_name)
303 try:
→ 304 response.raise_for_status()
305 except HTTPError as e:
18 frames
HTTPError: 401 Client Error: Unauthorized for url: https://huggingface.co/meta-llama/Meta-Llama-3.1-8B-Instruct/resolve/main/config.json
The above exception was the direct cause of the following exception:
GatedRepoError Traceback (most recent call last)
GatedRepoError: 401 Client Error. (Request ID: Root=1-66d95297-65f74eaa1c17c1b55ae0ff7c;c1376837-e11c-4833-909c-9437d3f2b778)
Cannot access gated repo for url
Access to model meta-llama/Meta-Llama-3.1-8B-Instruct is restricted. You must be authenticated to access it.
The above exception was the direct cause of the following exception:
OSError Traceback (most recent call last)
/usr/local/lib/python3.10/dist-packages/transformers/utils/hub.py in cached_file(path_or_repo_id, filename, cache_dir, force_download, resume_download, proxies, token, revision, local_files_only, subfolder, repo_type, user_agent, _raise_exceptions_for_gated_repo, _raise_exceptions_for_missing_entries, _raise_exceptions_for_connection_errors, _commit_hash, **deprecated_kwargs)
418 if resolved_file is not None or not _raise_exceptions_for_gated_repo:
419 return resolved_file
→ 420 raise EnvironmentError(
421 “You are trying to access a gated repo.\nMake sure to have access to it at "
422 f"https://huggingface.co/{path_or_repo_id}.\n{str(e)}”
OSError: You are trying to access a gated repo.
Make sure to have access to it at
401 Client Error. (Request ID: Root=1-66d95297-65f74eaa1c17c1b55ae0ff7c;c1376837-e11c-4833-909c-9437d3f2b778)