Lesson2 Gradio Example Build Failed error on Hugginface

Hi, I followed lesson 2 to build the Dogs vs. Cats model. I uploaded both the model pickle file and app.py file to Hugginface. Also added requirements.txt file in the folder with below dependency. Wondering if anyone know how to resolve this? really appreciate.

fastai
gradio

However Hugginface site can not build and show " Build failed with exit code: 1" error.
Log shows below error.

× Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [164 lines of output]
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
          int length
      
      
      cdef class Vocab:
          cdef Pool mem
          cpdef readonly StringStore strings
                ^
      ------------------------------------------------------------
      
      spacy/vocab.pxd:28:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      
      
      cdef class Vocab:
          cdef Pool mem
          cpdef readonly StringStore strings
          cpdef public Morphology morphology
                ^
      ------------------------------------------------------------
      
      spacy/vocab.pxd:29:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
      

Actually I found out this is due to gradio syntax changed a bit. Use below worked.

image=gr.Image(width=192, height=192)
label=gr.Label()
examples=[‘dog.jpg’,‘cat.jpg’]
intf=gr.Interface(fn=classify_image,inputs=image,outputs=label,examples=examples)

can you please provide the link to the code of notebook for gradio model testing

Here you go.

thanks eric, i am running this code in kaggle but when i am clicking the link :

Running on local URL: http://127.0.0.1:7860

output : This site can’t be reached

127.0.0.1 refused to connect.

Try:


Running on public URL: https://8286e5ecb15619c4e5.gradio.live

output : No interface is running right now

please help!!!

this is my notebook : notebook1ab43e0bcc | Kaggle

This code needs to be run on Hugginface. Create a space on Hugginface first. it is mentioned in lesson 2.

ok bro