# Error when i switch the Space to public

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-when-i-switch-the-space-to-public%2F27538%3E%5C
**Category:** Spaces\
**Created:** [December 9, 2022, 12:05pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-when-i-switch-the-space-to-public%2F27538 "2022-12-09T12:05:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![brewmeakay](https://avatars.discourse-cdn.com/v4/letter/b/f05b48/32.png) [@brewmeakay](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fbrewmeakay)%5C
**Post date:** [December 9, 2022, 12:05pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-when-i-switch-the-space-to-public%2F27538%2F1 "2022-12-09T12:05:07Z")

</div>

My space works fine when it’s on private mode but once i switch to public i get the following error:

```
Your space is on error, check its status on hf.co

```

### My code

```python
import gradio as gr
from fastai.vision.all import *

learn = load_learner('peaky.pkl')

categories = ('Ada Shelby','Arthur Shelby','John Shelby','Michael Gray','Polly Gray','Thomas Shelby')

def classify_image(img):
    pred,idx,probs = learn.predict(img)
    return dict(zip(categories,map(float,probs)))

image = gr.inputs.Image(shape=(192,192))
label = gr.outputs.Label()
examples = ['art1.jpg','john1.jpg','ada1.jpg','mic1.jpg','tom1.jpg']

intf = gr.Interface(fn=classify_image,inputs=image,outputs=label,examples=examples)
intf.launch(inline=False)

```

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fradames)%5C
**Post date:** [December 10, 2022, 12:53am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-when-i-switch-the-space-to-public%2F27538%2F2 "2022-12-10T00:53:58Z")

</div>

hi @brewmeakay , that’s interesting, could you please share your public Space project URL?

---

<div class="post-metadata">

**Author:** ![brewmeakay](https://avatars.discourse-cdn.com/v4/letter/b/f05b48/32.png) [@brewmeakay](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fbrewmeakay)%5C
**Post date:** [December 10, 2022, 11:12am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-when-i-switch-the-space-to-public%2F27538%2F3 "2022-12-10T11:12:34Z")

</div>

hi @radames . here’s the link for the space

> **[Peakyblinders - a Hugging Face Space by brewmeakay](https://huggingface.co/spaces/brewmeakay/peakyblinders)**
>
> Discover amazing ML apps made by the community

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fradames)%5C
**Post date:** [December 11, 2022, 4:02pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-when-i-switch-the-space-to-public%2F27538%2F4 "2022-12-11T16:02:06Z")

</div>

hi @brewmeakay , it looks like it’s working now! 🙌

---

<div class="post-metadata">

**Author:** ![brewmeakay](https://avatars.discourse-cdn.com/v4/letter/b/f05b48/32.png) [@brewmeakay](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fbrewmeakay)%5C
**Post date:** [December 12, 2022, 10:40am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-when-i-switch-the-space-to-public%2F27538%2F5 "2022-12-12T10:40:22Z")

</div>

it seems like it’s just not working on my browser. if i open the link in private window it works. Maybe a cache problem or something.  
thanks for the help @radames
