medbenhasan commited on
Commit
7d0ed75
1 Parent(s): 694bfba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -2,10 +2,16 @@ from flask import Flask, request, jsonify
2
  from huggingface_hub import from_pretrained_fastai
3
  from PIL import Image
4
  import io
 
5
 
6
  app = Flask(__name__)
7
 
8
- # Load the model
 
 
 
 
 
9
  learn = from_pretrained_fastai("hugginglearners/brain-tumor-detection-mri")
10
 
11
  @app.route('/predict', methods=['POST'])
 
2
  from huggingface_hub import from_pretrained_fastai
3
  from PIL import Image
4
  import io
5
+ import os
6
 
7
  app = Flask(__name__)
8
 
9
+ # Set the cache directory to a local path within the app
10
+ os.environ['HF_HOME'] = './.cache'
11
+
12
+ # Now import from huggingface_hub
13
+ from huggingface_hub import from_pretrained_fastai
14
+
15
  learn = from_pretrained_fastai("hugginglearners/brain-tumor-detection-mri")
16
 
17
  @app.route('/predict', methods=['POST'])