mdanish commited on
Commit
b5f0d2f
·
verified ·
1 Parent(s): d688d11

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -52,22 +52,22 @@ def main():
52
  # Load model (uses st.cache_resource)
53
  with st.spinner('Loading model... This may take a moment.'):
54
  model, preprocess, tokenizer = load_model()
55
- except Exception as e:
56
- st.error(f"Error loading model: {str(e)}")
57
- st.info("Please make sure you have enough memory and the correct dependencies installed.")
58
 
59
- knn = np.load(modelpath)
60
- st.write(knn['walkability_vecs'].shape)
61
 
62
- file = st.file_uploader('Upload An Image')
63
 
64
- if file:
65
- try:
66
- with Image.open(file) as img:
67
- st.write(file)
68
- st.write(img.size)
69
- except Exception as e:
70
- st.error(f"Error processing image: {str(e)}")
71
 
72
  if __name__ == "__main__":
73
  main()
 
52
  # Load model (uses st.cache_resource)
53
  with st.spinner('Loading model... This may take a moment.'):
54
  model, preprocess, tokenizer = load_model()
55
+ except Exception as e:
56
+ st.error(f"Error loading model: {str(e)}")
57
+ st.info("Please make sure you have enough memory and the correct dependencies installed.")
58
 
59
+ knn = np.load(modelpath)
60
+ st.write(knn['walkability_vecs'].shape)
61
 
62
+ file = st.file_uploader('Upload An Image')
63
 
64
+ if file:
65
+ try:
66
+ with Image.open(file) as img:
67
+ st.write(file)
68
+ st.write(img.size)
69
+ except Exception as e:
70
+ st.error(f"Error processing image: {str(e)}")
71
 
72
  if __name__ == "__main__":
73
  main()