Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,10 +31,6 @@ app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024
|
|
| 31 |
app.config['ALLOWED_EXTENSIONS'] = {'jpg', 'jpeg', 'png'}
|
| 32 |
app.config['OPENROUTER_MODEL'] = 'openai/gpt-oss-120b'
|
| 33 |
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
| 34 |
-
|
| 35 |
-
with app.app_context():
|
| 36 |
-
init_db()
|
| 37 |
-
|
| 38 |
|
| 39 |
def get_model_path():
|
| 40 |
classification_path = hf_hub_download(
|
|
@@ -77,6 +73,9 @@ def init_db():
|
|
| 77 |
conn.commit()
|
| 78 |
conn.close()
|
| 79 |
|
|
|
|
|
|
|
|
|
|
| 80 |
# Helper functions for model inference
|
| 81 |
def dice_coefficient(y_true, y_pred, smooth=1):
|
| 82 |
y_true_f = tf.keras.backend.flatten(y_true)
|
|
|
|
| 31 |
app.config['ALLOWED_EXTENSIONS'] = {'jpg', 'jpeg', 'png'}
|
| 32 |
app.config['OPENROUTER_MODEL'] = 'openai/gpt-oss-120b'
|
| 33 |
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
def get_model_path():
|
| 36 |
classification_path = hf_hub_download(
|
|
|
|
| 73 |
conn.commit()
|
| 74 |
conn.close()
|
| 75 |
|
| 76 |
+
with app.app_context():
|
| 77 |
+
init_db()
|
| 78 |
+
|
| 79 |
# Helper functions for model inference
|
| 80 |
def dice_coefficient(y_true, y_pred, smooth=1):
|
| 81 |
y_true_f = tf.keras.backend.flatten(y_true)
|