| ```CODE: | |
| # Use a pipeline as a high-level helper | |
| from transformers import pipeline | |
| pipe = pipeline("text-generation", model="ByteDance-Seed/Stable-DiffCoder-8B-Instruct", trust_remote_code=True) | |
| messages = [ | |
| {"role": "user", "content": "Who are you?"}, | |
| ] | |
| pipe(messages) | |
| ``` | |
| ERROR: | |
| Traceback (most recent call last): | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/httpx/_transports/default.py", line 101, in map_httpcore_exceptions | |
| yield | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/httpx/_transports/default.py", line 250, in handle_request | |
| resp = self._pool.handle_request(req) | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/httpcore/_sync/connection_pool.py", line 256, in handle_request | |
| raise exc from None | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/httpcore/_sync/connection_pool.py", line 236, in handle_request | |
| response = connection.handle_request( | |
| pool_request.request | |
| ) | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/httpcore/_sync/connection.py", line 103, in handle_request | |
| return self._connection.handle_request(request) | |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^ | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/httpcore/_sync/http11.py", line 136, in handle_request | |
| raise exc | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/httpcore/_sync/http11.py", line 106, in handle_request | |
| ) = self._receive_response_headers(**kwargs) | |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^ | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/httpcore/_sync/http11.py", line 177, in _receive_response_headers | |
| event = self._receive_event(timeout=timeout) | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/httpcore/_sync/http11.py", line 217, in _receive_event | |
| data = self._network_stream.read( | |
| self.READ_NUM_BYTES, timeout=timeout | |
| ) | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/httpcore/_backends/sync.py", line 126, in read | |
| with map_exceptions(exc_map): | |
| ~~~~~~~~~~~~~~^^^^^^^^^ | |
| File "/usr/lib/python3.13/contextlib.py", line 162, in __exit__ | |
| self.gen.throw(value) | |
| ~~~~~~~~~~~~~~^^^^^^^ | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions | |
| raise to_exc(exc) from exc | |
| httpcore.ReadTimeout: The read operation timed out | |
| The above exception was the direct cause of the following exception: | |
| Traceback (most recent call last): | |
| File "/tmp/ByteDance-Seed_Stable-DiffCoder-8B-Instruct_0n4qxnm.py", line 26, in <module> | |
| pipe = pipeline("text-generation", model="ByteDance-Seed/Stable-DiffCoder-8B-Instruct", trust_remote_code=True) | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/transformers/pipelines/__init__.py", line 836, in pipeline | |
| model = load_model( | |
| adapter_path if adapter_path is not None else model, | |
| ...<4 lines>... | |
| **model_kwargs, | |
| ) | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/transformers/pipelines/base.py", line 232, in load_model | |
| model = model_class.from_pretrained(model, **kwargs) | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/transformers/models/auto/auto_factory.py", line 365, in from_pretrained | |
| return model_class.from_pretrained( | |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^ | |
| pretrained_model_name_or_path, *model_args, config=config, **hub_kwargs, **kwargs | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| ) | |
| ^ | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/transformers/modeling_utils.py", line 4038, in from_pretrained | |
| checkpoint_files, sharded_metadata = _get_resolved_checkpoint_files( | |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ | |
| pretrained_model_name_or_path=pretrained_model_name_or_path, | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| ...<6 lines>... | |
| transformers_explicit_filename=getattr(config, "transformers_weights", None), | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| ) | |
| ^ | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/transformers/modeling_utils.py", line 760, in _get_resolved_checkpoint_files | |
| checkpoint_files, sharded_metadata = get_checkpoint_shard_files( | |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^ | |
| pretrained_model_name_or_path, | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| ...<9 lines>... | |
| _commit_hash=commit_hash, | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| ) | |
| ^ | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/transformers/utils/hub.py", line 869, in get_checkpoint_shard_files | |
| cached_filenames = cached_files( | |
| pretrained_model_name_or_path, | |
| ...<9 lines>... | |
| _commit_hash=_commit_hash, | |
| ) | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/transformers/utils/hub.py", line 507, in cached_files | |
| raise e | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/transformers/utils/hub.py", line 433, in cached_files | |
| snapshot_download( | |
| ~~~~~~~~~~~~~~~~~^ | |
| path_or_repo_id, | |
| ^^^^^^^^^^^^^^^^ | |
| ...<8 lines>... | |
| local_files_only=local_files_only, | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| ) | |
| ^ | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/huggingface_hub/utils/_validators.py", line 89, in _inner_fn | |
| return fn(*args, **kwargs) | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/huggingface_hub/_snapshot_download.py", line 449, in snapshot_download | |
| thread_map( | |
| ~~~~~~~~~~^ | |
| _inner_hf_hub_download, | |
| ^^^^^^^^^^^^^^^^^^^^^^^ | |
| ...<3 lines>... | |
| tqdm_class=tqdm_class, | |
| ^^^^^^^^^^^^^^^^^^^^^^ | |
| ) | |
| ^ | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/tqdm/contrib/concurrent.py", line 69, in thread_map | |
| return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs) | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/tqdm/contrib/concurrent.py", line 51, in _executor_map | |
| return list(tqdm_class(ex.map(fn, *iterables, chunksize=chunksize), **kwargs)) | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/tqdm/std.py", line 1181, in __iter__ | |
| for obj in iterable: | |
| ^^^^^^^^ | |
| File "/usr/lib/python3.13/concurrent/futures/_base.py", line 619, in result_iterator | |
| yield _result_or_cancel(fs.pop()) | |
| ~~~~~~~~~~~~~~~~~^^^^^^^^^^ | |
| File "/usr/lib/python3.13/concurrent/futures/_base.py", line 317, in _result_or_cancel | |
| return fut.result(timeout) | |
| ~~~~~~~~~~^^^^^^^^^ | |
| File "/usr/lib/python3.13/concurrent/futures/_base.py", line 456, in result | |
| return self.__get_result() | |
| ~~~~~~~~~~~~~~~~~^^ | |
| File "/usr/lib/python3.13/concurrent/futures/_base.py", line 401, in __get_result | |
| raise self._exception | |
| File "/usr/lib/python3.13/concurrent/futures/thread.py", line 59, in run | |
| result = self.fn(*self.args, **self.kwargs) | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/huggingface_hub/_snapshot_download.py", line 429, in _inner_hf_hub_download | |
| hf_hub_download( # type: ignore | |
| ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^ | |
| repo_id, | |
| ^^^^^^^^ | |
| ...<14 lines>... | |
| dry_run=dry_run, | |
| ^^^^^^^^^^^^^^^^ | |
| ) | |
| ^ | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/huggingface_hub/utils/_validators.py", line 89, in _inner_fn | |
| return fn(*args, **kwargs) | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 1024, in hf_hub_download | |
| return _hf_hub_download_to_cache_dir( | |
| # Destination | |
| ...<15 lines>... | |
| dry_run=dry_run, | |
| ) | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 1240, in _hf_hub_download_to_cache_dir | |
| _download_to_tmp_and_move( | |
| ~~~~~~~~~~~~~~~~~~~~~~~~~^ | |
| incomplete_path=Path(blob_path + ".incomplete"), | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| ...<8 lines>... | |
| tqdm_class=tqdm_class, | |
| ^^^^^^^^^^^^^^^^^^^^^^ | |
| ) | |
| ^ | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 1864, in _download_to_tmp_and_move | |
| xet_get( | |
| ~~~~~~~^ | |
| incomplete_path=incomplete_path, | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| ...<4 lines>... | |
| tqdm_class=tqdm_class, | |
| ^^^^^^^^^^^^^^^^^^^^^^ | |
| ) | |
| ^ | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 552, in xet_get | |
| connection_info = refresh_xet_connection_info(file_data=xet_file_data, headers=headers) | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/huggingface_hub/utils/_validators.py", line 89, in _inner_fn | |
| return fn(*args, **kwargs) | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/huggingface_hub/utils/_xet.py", line 122, in refresh_xet_connection_info | |
| return _fetch_xet_connection_info_with_url(file_data.refresh_route, headers) | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/huggingface_hub/utils/_validators.py", line 89, in _inner_fn | |
| return fn(*args, **kwargs) | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/huggingface_hub/utils/_xet.py", line 203, in _fetch_xet_connection_info_with_url | |
| resp = get_session().get(headers=headers, url=url, params=params) | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/httpx/_client.py", line 1053, in get | |
| return self.request( | |
| ~~~~~~~~~~~~^ | |
| "GET", | |
| ^^^^^^ | |
| ...<7 lines>... | |
| extensions=extensions, | |
| ^^^^^^^^^^^^^^^^^^^^^^ | |
| ) | |
| ^ | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/httpx/_client.py", line 825, in request | |
| return self.send(request, auth=auth, follow_redirects=follow_redirects) | |
| ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/httpx/_client.py", line 914, in send | |
| response = self._send_handling_auth( | |
| request, | |
| ...<2 lines>... | |
| history=[], | |
| ) | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/httpx/_client.py", line 942, in _send_handling_auth | |
| response = self._send_handling_redirects( | |
| request, | |
| follow_redirects=follow_redirects, | |
| history=history, | |
| ) | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/httpx/_client.py", line 979, in _send_handling_redirects | |
| response = self._send_single_request(request) | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/httpx/_client.py", line 1014, in _send_single_request | |
| response = transport.handle_request(request) | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/httpx/_transports/default.py", line 249, in handle_request | |
| with map_httpcore_exceptions(): | |
| ~~~~~~~~~~~~~~~~~~~~~~~^^ | |
| File "/usr/lib/python3.13/contextlib.py", line 162, in __exit__ | |
| self.gen.throw(value) | |
| ~~~~~~~~~~~~~~^^^^^^^ | |
| File "/tmp/.cache/uv/environments-v2/d1df88e7f5c3f72a/lib/python3.13/site-packages/httpx/_transports/default.py", line 118, in map_httpcore_exceptions | |
| raise mapped_exc(message) from exc | |
| httpx.ReadTimeout: The read operation timed out | |