Text Generation
Transformers
Safetensors
dbrx
conversational
text-generation-inference

Error in downloading, even after i have signed up and got access to.

#26
by Balab2021 - opened

OSError: We couldn't connect to 'https://huggingface.co/' to load this model and it looks like databricks/dbrx-instruct is not the path to a directory conaining a config.json file.
Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.

Databricks org

This will be a problem with HuggingFace, or your connection to it. The files are there and accessible: https://huggingface.co/databricks/dbrx-instruct/tree/main

srowen changed discussion status to closed

same error although token is being passed

databricks/dbrx-instruct is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models'
If this is a private repository, make sure to pass a token having permission to this repo with use_auth_token or log in with huggingface-cli login and pass use_auth_token=True.

Databricks org

Can you confirm you have requested and been granted access to the model?

Can you show how you are loading the model?
I also suspect you are using a somewhat old version of transformers because it's referring to use_auth_token, not token.
The example in the model card should be correct, if you have permission to access the model.

srowen changed discussion status to open

Can you confirm you have requested and been granted access to the model? : Yes

Can you show how you are loading the model?

image.png

I also suspect you are using a somewhat old version of transformers because it's referring to use_auth_token, not token.
I am on the updated versions
transformers : 4.39.2
tiktoken : 0.6.0

Databricks org
edited Mar 29

It looks to me like you set your token when loading the tokenizer, but not the model. There are two places.
I see you updated the screenshot, but wanted to confirm you have definitely rerun this way with your correct token in both places.
Have you verified you can access Hugging Face in general? I would guess you can.
Can you show the actual error in this cell?

apologies, that was a bad screenshot. I can confirm that i have set the token for loading the tokenizer and the model.

Traceback (most recent call last):
File "/databricks/python/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py", line 264, in hf_raise_for_status
response.raise_for_status()
File "/databricks/python/lib/python3.9/site-packages/requests/models.py", line 960, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://huggingface.co/databricks/dbrx-instruct/resolve/main/tokenizer_config.json

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/databricks/python/lib/python3.9/site-packages/transformers/utils/hub.py", line 409, in cached_file
resolved_file = hf_hub_download(
File "/databricks/python/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py", line 124, in _inner_fn
return fn(*args, **kwargs)
File "/databricks/python/lib/python3.9/site-packages/huggingface_hub/file_download.py", line 1105, in hf_hub_download
metadata = get_hf_file_metadata(
File "/databricks/python/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py", line 124, in _inner_fn
return fn(*args, **kwargs)
File "/databricks/python/lib/python3.9/site-packages/huggingface_hub/file_download.py", line 1440, in get_hf_file_metadata
hf_raise_for_status(r)
File "/databricks/python/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py", line 290, in hf_raise_for_status
raise GatedRepoError(message, response) from e
huggingface_hub.utils._errors.GatedRepoError: 401 Client Error. (Request ID: Root=1-66070ab5-68e2d4713bed59e23652904d)

Cannot access gated repo for url https://huggingface.co/databricks/dbrx-instruct/resolve/main/tokenizer_config.json.
Repo model databricks/dbrx-instruct is gated. You must be authenticated to access it.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/databricks/python/lib/python3.9/site-packages/IPython/core/interactiveshell.py", line 3378, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 6, in
tokenizer = AutoTokenizer.from_pretrained("databricks/dbrx-instruct", trust_remote_code=True, token=access_token)
File "/databricks/python/lib/python3.9/site-packages/transformers/models/auto/tokenization_auto.py", line 582, in from_pretrained
tokenizer_config = get_tokenizer_config(pretrained_model_name_or_path, **kwargs)
File "/databricks/python/lib/python3.9/site-packages/transformers/models/auto/tokenization_auto.py", line 433, in get_tokenizer_config
resolved_config_file = cached_file(
File "/databricks/python/lib/python3.9/site-packages/transformers/utils/hub.py", line 424, in cached_file
raise EnvironmentError(
OSError: databricks/dbrx-instruct is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models'
If this is a private repository, make sure to pass a token having permission to this repo with use_auth_token or log in with huggingface-cli login and pass use_auth_token=True.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/databricks/python/lib/python3.9/site-packages/IPython/core/interactiveshell.py", line 1997, in showtraceback
stb = self.InteractiveTB.structured_traceback(
File "/databricks/python/lib/python3.9/site-packages/IPython/core/ultratb.py", line 1112, in structured_traceback
return FormattedTB.structured_traceback(
File "/databricks/python/lib/python3.9/site-packages/IPython/core/ultratb.py", line 1006, in structured_traceback
return VerboseTB.structured_traceback(
File "/databricks/python/lib/python3.9/site-packages/IPython/core/ultratb.py", line 859, in structured_traceback
formatted_exception = self.format_exception_as_a_whole(etype, evalue, etb, number_of_lines_of_context,
File "/databricks/python/lib/python3.9/site-packages/IPython/core/ultratb.py", line 812, in format_exception_as_a_whole
frames.append(self.format_record(r))
File "/databricks/python/lib/python3.9/site-packages/IPython/core/ultratb.py", line 730, in format_record
result += ''.join(_format_traceback_lines(frame_info.lines, Colors, self.has_colors, lvals))
File "/databricks/python/lib/python3.9/site-packages/stack_data/utils.py", line 145, in cached_property_wrapper
value = obj.dict[self.func.name] = self.func(obj)
File "/databricks/python/lib/python3.9/site-packages/stack_data/core.py", line 698, in lines
pieces = self.included_pieces
File "/databricks/python/lib/python3.9/site-packages/stack_data/utils.py", line 145, in cached_property_wrapper
value = obj.dict[self.func.name] = self.func(obj)
File "/databricks/python/lib/python3.9/site-packages/stack_data/core.py", line 649, in included_pieces
pos = scope_pieces.index(self.executing_piece)
File "/databricks/python/lib/python3.9/site-packages/stack_data/utils.py", line 145, in cached_property_wrapper
value = obj.dict[self.func.name] = self.func(obj)
File "/databricks/python/lib/python3.9/site-packages/stack_data/core.py", line 628, in executing_piece
return only(
File "/databricks/python/lib/python3.9/site-packages/executing/executing.py", line 164, in only
raise NotOneValueFound('Expected one value, found 0')
executing.executing.NotOneValueFound: Expected one value, found 0

Model access has been granted already.

image.png

Databricks org

I think you must still have a problem with your token. It's all fine now except it's saying you're unauthorized.
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://huggingface.co/databricks/dbrx-instruct/resolve/main/tokenizer_config.json
Can you access other gated models, like LLama 2?
Perhaps it's the wrong token, or the wrong account? I'm not sure what else it could be. Your code looks right and it worked for me to access it, FWIW, on my personal laptop.

Yep, looks correct to me as well and I have been able to use other gated models. Thanks for the help and looking at it, I will let you know if I figure out what is causing the auth issue.
Happy friday !

Update:
Solved
Steps:

  1. restart cluster
  2. !pip install -U transformers
    !pip install -U tiktoken
Databricks org

I think older versions of transformers used a different param for "token" (use_auth_token) so this could make sense. I will add an explicit pinned version to the README example to make this easier to avoid

srowen changed discussion status to closed

Sign up or log in to comment