anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: streamlit/streamlit
Issue: st.cache_data docstring for show_spinner is incorrect

### Checklist

- [X] I have searched the [existing issues](https://github.com/streamlit/streamlit/issues) for similar issues.
- [X] I added a very descriptive title to this issue.
- [X] I have provided sufficient information below to help reproduce this issue.

### Summary

The docstring for `st.cache_data` (which is used in the API Reference docs) lists the only supported type of `show_spinner` argument as boolean. However it also accepts a string. It should be updated to reflect the actual behavior.

https://docs.streamlit.io/library/api-reference/performance/st.cache_data

I believe it works the same as cache_resource, so it could copy that docstring.

### Reproducible Code Example

_No response_

### Steps To Reproduce

_No response_

### Expected Behavior

_No response_

### Current Behavior

_No response_

### Is this a regression?

- [ ] Yes, this used to work in a previous version.

### Debug info

- Streamlit version: 1.19

### Additional Information

_No response_

### Are you willing to submit a PR?

- [X] Yes, I am willing to submit a PR!

Changed files:
lib/streamlit/runtime/caching/cache_data_api.py

diff --git a/lib/streamlit/runtime/caching/cache_data_api.py b/lib/streamlit/runtime/caching/cache_data_api.py
index 47f9d284e..2e738ef44 100644
--- a/lib/streamlit/runtime/caching/cache_data_api.py
+++ b/lib/streamlit/runtime/caching/cache_data_api.py
@@ -413,9 +413,10 @@ class CacheDataAPI:
             for an unbounded cache. (When a new entry is added to a full cache,
             the oldest cached entry will be removed.) The default is None.
 
-        show_spinner : boolean
+        show_spinner : boolean or string
             Enable the spinner. Default is True to show a spinner when there is
-            a cache miss.
+            a "cache miss" and the cached data is being created. If string,
+            value of show_spinner param will be used for spinner text.
 
         persist : str or boolean or None
             Optional location to persist cached data to. Passing "disk" (or True)
@@ -574,7 +575,6 @@ class DataCache(Cache):
         self.allow_widgets = allow_widgets
 
     def get_stats(self) -> list[CacheStat]:
-
         if isinstance(self.storage, CacheStatsProvider):
             return self.storage.get_stats()
         return []
Repository: streamlit/streamlit
Issue: Change websocket ping time to 1s to improve connection resilience?

### Summary

The websocket connection drops consistently for [this user](https://discuss.streamlit.io/t/frustrated-streamlit-frontend-disconnects-from-apps-with-long-running-processes/11612). 

In `sever/server.py`, when we change this:
```
    "websocket_ping_interval": 20,  # Ping every 20s to keep WS alive.
```
...to this:
```
    "websocket_ping_interval": 1,  # Ping every 1s to keep WS alive.
```
...the problem goes away.

**Can we make this the default?**


### Steps to reproduce

We couldn't find a toy scenario to repro this :(

### Is this a regression?

Don't think so

### Debug info

- Streamlit version: 0.80.0
- Python version: (get it with `$ python --version`)
- Using Conda
- OS version:
- Browser version:


Changed files:
lib/streamlit/server/server.py

diff --git a/lib/streamlit/server/server.py b/lib/streamlit/server/server.py
index 239280790..698daa983 100644
--- a/lib/streamlit/server/server.py
+++ b/lib/streamlit/server/server.py
@@ -69,10 +69,19 @@ LOGGER = get_logger(__name__)
 
 
 TORNADO_SETTINGS = {
-    "compress_response": True,  # Gzip HTTP responses.
-    "websocket_ping_interval": 20,  # Ping every 20s to keep WS alive.
-    "websocket_ping_timeout": 30,  # Pings should be responded to within 30s.
-    "websocket_max_message_size": MESSAGE_SIZE_LIMIT,  # Up the WS size limit.
+    # Gzip HTTP responses.
+    "compress_response": True,
+    # Ping every 1s to keep WS alive.
+    # 2021.06.22: this value was previously 20s, and was causing
+    # connection instability for a small number of users. This smaller
+    # ping_interval fixes that instability.
+    # https://github.com/streamlit/streamlit/issues/3196
+    "websocket_ping_interval": 1,
+    # If we don't get a ping response within 30s, the connection
+    # is timed out.
+    "websocket_ping_timeout": 30,
+    # Set the websocket message size. The default value is too low.
+    "websocket_max_message_size": MESSAGE_SIZE_LIMIT,
 }
Repository: huggingface/pytorch-image-models
Issue: [BUG] Update Hugging Face integration to use hf_hub_download

**Describe the bug**

`cached_download` is being deprecated. 

```
/usr/local/lib/python3.7/dist-packages/huggingface_hub/file_download.py:563: FutureWarning: `cached_download` is the legacy way to download files from the HF hub, please consider upgrading to `hf_hub_download`
```

**To Reproduce**
Steps to reproduce the behavior:

Authenticate w/ huggingface with `huggingface-cli login` or `huggingface_hub.notebook_login` if you're in a notebook.

then run

```python
import timm

# Build a model 🔧
model = timm.create_model('resnet18', pretrained=True, num_classes=4)

# Push it to the 🤗 hub
timm.models.hub.push_to_hf_hub(
    model,
    'resnet18-random-classifier',
    model_config={'labels': ['a', 'b', 'c', 'd']}
)
```

**Expected behavior**
There should be no warning

**Screenshots**
N/A

**Desktop (please complete the following information):**
 - Colab, `timm` latest PyPi release.

**Additional context**

I should be able to issue this fix if you want @rwightman 


Changed files:
timm/models/hub.py

diff --git a/timm/models/hub.py b/timm/models/hub.py
index dd7870c..c3d3d15 100644
--- a/timm/models/hub.py
+++ b/timm/models/hub.py
@@ -14,11 +14,11 @@ except ImportError:
 
 from timm import __version__
 try:
-    from huggingface_hub import HfApi, HfFolder, Repository, cached_download, hf_hub_url
-    cached_download = partial(cached_download, library_name="timm", library_version=__version__)
+    from huggingface_hub import HfApi, HfFolder, Repository, hf_hub_download, hf_hub_url
+    hf_hub_download = partial(hf_hub_download, library_name="timm", library_version=__version__)
     _has_hf_hub = True
 except ImportError:
-    cached_download = None
+    hf_hub_download = None
     _has_hf_hub = False
 
 _logger = logging.getLogger(__name__)
@@ -78,8 +78,7 @@ def load_cfg_from_json(json_file: Union[str, os.PathLike]):
 
 def _download_from_hf(model_id: str, filename: str):
     hf_model_id, hf_revision = hf_split(model_id)
-    url = hf_hub_url(hf_model_id, filename, revision=hf_revision)
-    return cached_download(url, cache_dir=get_cache_dir('hf'))
+    return hf_hub_download(hf_model_id, filename, revision=hf_revision, cache_dir=get_cache_dir('hf'))
 
 
 def load_model_config_from_hf(model_id: str):
Repository: huggingface/pytorch-image-models
Issue: [BUG] AugMix 

Hi Ross,

Thank you for including AugMix in your wonderful library!

It looks like the augmentation severity parameter is currently fixed at the maximum allowed severity (unless explicitly enabled with magnitude_std): 

https://github.com/rwightman/pytorch-image-models/blob/4203efa36d0258315f51ad8f945849586b058408/timm/data/auto_augment.py#L337-L345

However, AugMix actually samples different severities uniformly at random in the range [0, magnitude] for each application of each op:

https://github.com/google-research/augmix/blob/master/augmentations.py#L70

Sorry this wasn't more clear in our implementation and paper!

Norman

Changed files:
timm/data/auto_augment.py

diff --git a/timm/data/auto_augment.py b/timm/data/auto_augment.py
index cbf5464..7cbd2de 100644
--- a/timm/data/auto_augment.py
+++ b/timm/data/auto_augment.py
@@ -332,14 +332,18 @@ class AugmentOp:
         # in the usually fixed policy and sample magnitude from a normal distribution
         # with mean `magnitude` and std-dev of `magnitude_std`.
         # NOTE This is my own hack, being tested, not in papers or reference impls.
+        # If magnitude_std is inf, we sample magnitude from a uniform distribution
         self.magnitude_std = self.hparams.get('magnitude_std', 0)
 
     def __call__(self, img):
         if self.prob < 1.0 and random.random() > self.prob:
             return img
         magnitude = self.magnitude
-        if self.magnitude_std and self.magnitude_std > 0:
-            magnitude = random.gauss(magnitude, self.magnitude_std)
+        if self.magnitude_std:
+            if self.magnitude_std == float('inf'):
+                magnitude = random.uniform(0, magnitude)
+            elif self.magnitude_std > 0:
+                magnitude = random.gauss(magnitude, self.magnitude_std)
         magnitude = min(_MAX_LEVEL, max(0, magnitude))  # clip to valid range
         level_args = self.level_fn(magnitude, self.hparams) if self.level_fn is not None else tuple()
         return self.aug_fn(img, *level_args, **self.kwargs)
@@ -790,6 +794,7 @@ def augment_and_mix_transform(config_str, hparams):
     depth = -1
     alpha = 1.
     blended = False
+    hparams['magnitude_std'] = float('inf')
     config = config_str.split('-')
     assert config[0] == 'augmix'
     config = config[1:]