Spaces:
Running
Running
Commit
·
4cca3cd
1
Parent(s):
6c618a1
Fix port binding issue in app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,5 @@
|
|
1 |
-
# import sys
|
2 |
-
# import os
|
3 |
-
# sys.path.insert(0, os.path.abspath("C:\Users\KRUNAL\Desktop\my_ocr_project\PaddleOCR"))
|
4 |
-
|
5 |
-
from flask import Flask, render_template, request, send_from_directory
|
6 |
import os
|
|
|
7 |
from paddleocr import PaddleOCR
|
8 |
|
9 |
app = Flask(__name__)
|
@@ -39,4 +35,6 @@ def uploaded_file(filename):
|
|
39 |
return send_from_directory(app.config['UPLOAD_FOLDER'], filename)
|
40 |
|
41 |
if __name__ == '__main__':
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import os
|
2 |
+
from flask import Flask, render_template, request, send_from_directory
|
3 |
from paddleocr import PaddleOCR
|
4 |
|
5 |
app = Flask(__name__)
|
|
|
35 |
return send_from_directory(app.config['UPLOAD_FOLDER'], filename)
|
36 |
|
37 |
if __name__ == '__main__':
|
38 |
+
port = int(os.environ.get("PORT", 5000)) # Corrected indentation here
|
39 |
+
# Run the app, binding to all IP addresses and the correct port
|
40 |
+
app.run(host="0.0.0.0", port=port)
|