fix
Browse files- __pycache__/create_app.cpython-312.pyc +0 -0
- __pycache__/database.cpython-312.pyc +0 -0
- create_app.py +3 -3
- database.py +1 -1
- inference/__pycache__/__init__.cpython-312.pyc +0 -0
- inference/__pycache__/infer_single.cpython-312.pyc +0 -0
- inference/infer_single.py +1 -1
- models/__pycache__/__init__.cpython-312.pyc +0 -0
- models/__pycache__/model.cpython-312.pyc +0 -0
- utils/__pycache__/__init__.cpython-312.pyc +0 -0
- utils/__pycache__/data_utils.cpython-312.pyc +0 -0
- utils/__pycache__/prompts.cpython-312.pyc +0 -0
- utils/__pycache__/util_func.cpython-312.pyc +0 -0
- views/__pycache__/__init__.cpython-312.pyc +0 -0
- views/__pycache__/about.cpython-312.pyc +0 -0
- views/__pycache__/auth.cpython-312.pyc +0 -0
- views/__pycache__/dashboard.cpython-312.pyc +0 -0
- views/__pycache__/error.cpython-312.pyc +0 -0
- views/__pycache__/infer.cpython-312.pyc +0 -0
- views/auth.py +3 -3
- views/dashboard.py +1 -1
- views/infer.py +1 -1
__pycache__/create_app.cpython-312.pyc
ADDED
|
Binary file (4.04 kB). View file
|
|
|
__pycache__/database.cpython-312.pyc
ADDED
|
Binary file (2.79 kB). View file
|
|
|
create_app.py
CHANGED
|
@@ -36,7 +36,7 @@ def create_app():
|
|
| 36 |
set_seed(42)
|
| 37 |
load_models()
|
| 38 |
app = Flask(__name__)
|
| 39 |
-
app.config.from_pyfile('
|
| 40 |
db.init_app(app)
|
| 41 |
login_manager.init_app(app)
|
| 42 |
login_manager.login_view = 'auth.login'
|
|
@@ -45,7 +45,7 @@ def create_app():
|
|
| 45 |
return User.query.get(int(user_id))
|
| 46 |
|
| 47 |
with app.app_context():
|
| 48 |
-
from
|
| 49 |
app.register_blueprint(auth_bp)
|
| 50 |
app.register_blueprint(dashboard_bp)
|
| 51 |
app.register_blueprint(infer_bp)
|
|
@@ -56,7 +56,7 @@ def create_app():
|
|
| 56 |
code = getattr(e, 'code', 500)
|
| 57 |
error_message = str(e) if hasattr(e, 'description') else "Something went wrong."
|
| 58 |
return render_template('error.html', code=code, error_message=error_message), code
|
| 59 |
-
from
|
| 60 |
db.create_all()
|
| 61 |
|
| 62 |
return app
|
|
|
|
| 36 |
set_seed(42)
|
| 37 |
load_models()
|
| 38 |
app = Flask(__name__)
|
| 39 |
+
app.config.from_pyfile('configs.py')
|
| 40 |
db.init_app(app)
|
| 41 |
login_manager.init_app(app)
|
| 42 |
login_manager.login_view = 'auth.login'
|
|
|
|
| 45 |
return User.query.get(int(user_id))
|
| 46 |
|
| 47 |
with app.app_context():
|
| 48 |
+
from views import auth_bp, dashboard_bp, infer_bp, about_bp, error_bp
|
| 49 |
app.register_blueprint(auth_bp)
|
| 50 |
app.register_blueprint(dashboard_bp)
|
| 51 |
app.register_blueprint(infer_bp)
|
|
|
|
| 56 |
code = getattr(e, 'code', 500)
|
| 57 |
error_message = str(e) if hasattr(e, 'description') else "Something went wrong."
|
| 58 |
return render_template('error.html', code=code, error_message=error_message), code
|
| 59 |
+
from database import User, History
|
| 60 |
db.create_all()
|
| 61 |
|
| 62 |
return app
|
database.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
from flask_login import UserMixin
|
| 2 |
from werkzeug.security import generate_password_hash, check_password_hash
|
| 3 |
from datetime import datetime
|
| 4 |
-
from
|
| 5 |
|
| 6 |
class User(UserMixin, db.Model):
|
| 7 |
id = db.Column(db.Integer, primary_key=True)
|
|
|
|
| 1 |
from flask_login import UserMixin
|
| 2 |
from werkzeug.security import generate_password_hash, check_password_hash
|
| 3 |
from datetime import datetime
|
| 4 |
+
from create_app import db
|
| 5 |
|
| 6 |
class User(UserMixin, db.Model):
|
| 7 |
id = db.Column(db.Integer, primary_key=True)
|
inference/__pycache__/__init__.cpython-312.pyc
CHANGED
|
Binary files a/inference/__pycache__/__init__.cpython-312.pyc and b/inference/__pycache__/__init__.cpython-312.pyc differ
|
|
|
inference/__pycache__/infer_single.cpython-312.pyc
CHANGED
|
Binary files a/inference/__pycache__/infer_single.cpython-312.pyc and b/inference/__pycache__/infer_single.cpython-312.pyc differ
|
|
|
inference/infer_single.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
from utils.data_utils import *
|
| 2 |
from utils.prompts import *
|
| 3 |
import torch
|
| 4 |
-
from
|
| 5 |
|
| 6 |
def replace_single_newlines(text):
|
| 7 |
return re.sub(r'(?<!\n)\n(?!\n)', '\\\\n\\\\n', text)
|
|
|
|
| 1 |
from utils.data_utils import *
|
| 2 |
from utils.prompts import *
|
| 3 |
import torch
|
| 4 |
+
from create_app import *
|
| 5 |
|
| 6 |
def replace_single_newlines(text):
|
| 7 |
return re.sub(r'(?<!\n)\n(?!\n)', '\\\\n\\\\n', text)
|
models/__pycache__/__init__.cpython-312.pyc
CHANGED
|
Binary files a/models/__pycache__/__init__.cpython-312.pyc and b/models/__pycache__/__init__.cpython-312.pyc differ
|
|
|
models/__pycache__/model.cpython-312.pyc
CHANGED
|
Binary files a/models/__pycache__/model.cpython-312.pyc and b/models/__pycache__/model.cpython-312.pyc differ
|
|
|
utils/__pycache__/__init__.cpython-312.pyc
CHANGED
|
Binary files a/utils/__pycache__/__init__.cpython-312.pyc and b/utils/__pycache__/__init__.cpython-312.pyc differ
|
|
|
utils/__pycache__/data_utils.cpython-312.pyc
CHANGED
|
Binary files a/utils/__pycache__/data_utils.cpython-312.pyc and b/utils/__pycache__/data_utils.cpython-312.pyc differ
|
|
|
utils/__pycache__/prompts.cpython-312.pyc
CHANGED
|
Binary files a/utils/__pycache__/prompts.cpython-312.pyc and b/utils/__pycache__/prompts.cpython-312.pyc differ
|
|
|
utils/__pycache__/util_func.cpython-312.pyc
CHANGED
|
Binary files a/utils/__pycache__/util_func.cpython-312.pyc and b/utils/__pycache__/util_func.cpython-312.pyc differ
|
|
|
views/__pycache__/__init__.cpython-312.pyc
CHANGED
|
Binary files a/views/__pycache__/__init__.cpython-312.pyc and b/views/__pycache__/__init__.cpython-312.pyc differ
|
|
|
views/__pycache__/about.cpython-312.pyc
CHANGED
|
Binary files a/views/__pycache__/about.cpython-312.pyc and b/views/__pycache__/about.cpython-312.pyc differ
|
|
|
views/__pycache__/auth.cpython-312.pyc
CHANGED
|
Binary files a/views/__pycache__/auth.cpython-312.pyc and b/views/__pycache__/auth.cpython-312.pyc differ
|
|
|
views/__pycache__/dashboard.cpython-312.pyc
CHANGED
|
Binary files a/views/__pycache__/dashboard.cpython-312.pyc and b/views/__pycache__/dashboard.cpython-312.pyc differ
|
|
|
views/__pycache__/error.cpython-312.pyc
CHANGED
|
Binary files a/views/__pycache__/error.cpython-312.pyc and b/views/__pycache__/error.cpython-312.pyc differ
|
|
|
views/__pycache__/infer.cpython-312.pyc
CHANGED
|
Binary files a/views/__pycache__/infer.cpython-312.pyc and b/views/__pycache__/infer.cpython-312.pyc differ
|
|
|
views/auth.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
-
from flask import render_template, request, redirect, url_for
|
| 2 |
-
from flask_login import login_user, logout_user, login_required
|
| 3 |
from . import auth_bp
|
| 4 |
-
from
|
| 5 |
|
| 6 |
@auth_bp.route('/register', methods=['GET', 'POST'])
|
| 7 |
def register():
|
|
|
|
| 1 |
+
from flask import render_template, request, redirect, url_for
|
| 2 |
+
from flask_login import login_user, logout_user, login_required
|
| 3 |
from . import auth_bp
|
| 4 |
+
from database import User, db
|
| 5 |
|
| 6 |
@auth_bp.route('/register', methods=['GET', 'POST'])
|
| 7 |
def register():
|
views/dashboard.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
from flask import render_template, redirect, url_for, request, flash
|
| 2 |
from flask_login import login_required, current_user
|
| 3 |
from . import dashboard_bp
|
| 4 |
-
from
|
| 5 |
|
| 6 |
|
| 7 |
@dashboard_bp.route('/dashboard', defaults={'page': 1})
|
|
|
|
| 1 |
from flask import render_template, redirect, url_for, request, flash
|
| 2 |
from flask_login import login_required, current_user
|
| 3 |
from . import dashboard_bp
|
| 4 |
+
from database import History, db
|
| 5 |
|
| 6 |
|
| 7 |
@dashboard_bp.route('/dashboard', defaults={'page': 1})
|
views/infer.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
from flask import render_template, session, request, redirect, url_for, flash
|
| 2 |
from . import infer_bp
|
| 3 |
import secrets
|
| 4 |
-
from
|
| 5 |
from flask_login import current_user
|
| 6 |
from inference.infer_single import *
|
| 7 |
from utils.util_func import *
|
|
|
|
| 1 |
from flask import render_template, session, request, redirect, url_for, flash
|
| 2 |
from . import infer_bp
|
| 3 |
import secrets
|
| 4 |
+
from database import History, db
|
| 5 |
from flask_login import current_user
|
| 6 |
from inference.infer_single import *
|
| 7 |
from utils.util_func import *
|