update files again
Browse files- Dockerfile +2 -1
- app.py +6 -6
Dockerfile
CHANGED
|
@@ -1,7 +1,8 @@
|
|
| 1 |
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
| 2 |
# you will also find guides on how best to write your Dockerfile
|
| 3 |
|
| 4 |
-
FROM python:3.9
|
|
|
|
| 5 |
|
| 6 |
RUN useradd -m -u 1000 user
|
| 7 |
USER user
|
|
|
|
| 1 |
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
| 2 |
# you will also find guides on how best to write your Dockerfile
|
| 3 |
|
| 4 |
+
FROM python:3.9 AS compile-image
|
| 5 |
+
COPY --from=compile-image . /app
|
| 6 |
|
| 7 |
RUN useradd -m -u 1000 user
|
| 8 |
USER user
|
app.py
CHANGED
|
@@ -17,11 +17,11 @@ app.config["OUT"] = "anno"
|
|
| 17 |
app.config["LABELS"] = []
|
| 18 |
app.config["HEAD"] = 0
|
| 19 |
app.config["SESSION_PERMANENT"] = False
|
| 20 |
-
try:
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
except:
|
| 24 |
-
|
| 25 |
|
| 26 |
|
| 27 |
@app.route('/', methods=['GET', 'POST'])
|
|
@@ -49,7 +49,7 @@ def index():
|
|
| 49 |
f.save(os.path.join(img_folder, f.filename))
|
| 50 |
filenames.append(f.filename)
|
| 51 |
app.config["FILES"] = filenames
|
| 52 |
-
logger.info(app.config["FILES"], app.config["HEAD"])
|
| 53 |
return redirect('/tagger', code=302)
|
| 54 |
else:
|
| 55 |
return render_template('index.html')
|
|
|
|
| 17 |
app.config["LABELS"] = []
|
| 18 |
app.config["HEAD"] = 0
|
| 19 |
app.config["SESSION_PERMANENT"] = False
|
| 20 |
+
# try:
|
| 21 |
+
# os.mkdir(app.config["OUT"])
|
| 22 |
+
# os.mkdir(app.config["IMAGES"])
|
| 23 |
+
# except:
|
| 24 |
+
# pass
|
| 25 |
|
| 26 |
|
| 27 |
@app.route('/', methods=['GET', 'POST'])
|
|
|
|
| 49 |
f.save(os.path.join(img_folder, f.filename))
|
| 50 |
filenames.append(f.filename)
|
| 51 |
app.config["FILES"] = filenames
|
| 52 |
+
# logger.info(app.config["FILES"], app.config["HEAD"])
|
| 53 |
return redirect('/tagger', code=302)
|
| 54 |
else:
|
| 55 |
return render_template('index.html')
|