deployment fixes
This commit is contained in:
parent
d5419dffc9
commit
b6ff963bcb
@ -11,5 +11,5 @@ ENV SECRET_KEY="random_secret_key"
|
|||||||
|
|
||||||
EXPOSE 5050
|
EXPOSE 5050
|
||||||
|
|
||||||
# CMD ["python3", "app.py"]
|
CMD ["gunicorn", "--bind","0.0.0.0:5050","app:app"]
|
||||||
ENTRYPOINT ["tail", "-f", "/dev/null"]
|
#ENTRYPOINT ["tail", "-f", "/dev/null"]
|
||||||
|
@ -15,8 +15,9 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
with open(os.path.join('dataset', 'final_id_v2.jsonl'), encoding='utf-8') as file:
|
with open(os.path.join('dataset', 'final_id_v2.jsonl'), encoding='utf-8') as file:
|
||||||
data = [json.loads(line) for line in file]
|
for line in file:
|
||||||
db.session.add(Samples(data['text']))
|
data = json.loads(line)
|
||||||
|
db.session.add(Samples(data['text']))
|
||||||
|
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
print('Data sucessfully inserted')
|
print('Data sucessfully inserted')
|
||||||
|
@ -33,7 +33,7 @@ class Samples(db.Model):
|
|||||||
__tablename__ = 'samples'
|
__tablename__ = 'samples'
|
||||||
|
|
||||||
_id = db.Column("id", db.Integer, primary_key=True)
|
_id = db.Column("id", db.Integer, primary_key=True)
|
||||||
text = db.Column(db.String(512), nullable=False)
|
text = db.Column(db.Text, nullable=False)
|
||||||
annotations = db.relationship('Annotations', lazy=True, backref='sample') # corrected relationship and added backref
|
annotations = db.relationship('Annotations', lazy=True, backref='sample') # corrected relationship and added backref
|
||||||
|
|
||||||
def __init__(self, text):
|
def __init__(self, text):
|
||||||
|
@ -12,3 +12,4 @@ typing_extensions==4.10.0
|
|||||||
Werkzeug==3.0.1
|
Werkzeug==3.0.1
|
||||||
zipp==3.18.1
|
zipp==3.18.1
|
||||||
psycopg2-binary
|
psycopg2-binary
|
||||||
|
gunicorn
|
||||||
|
Loading…
Reference in New Issue
Block a user