Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ services:
MONGO_INITDB_ROOT_USERNAME: mongo_user
MONGO_INITDB_ROOT_PASSWORD: mongo_password
ports:
- 27017:27017 # remove this line on prod
- 27018:27018 # remove this line on prod
2 changes: 1 addition & 1 deletion model-hub/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
app = Flask(__name__)

app.config["MONGO_DBNAME"] = "modelhubdb"
app.config["MONGO_URI"] = "mongodb://localhost:27017/modelhubdb"
app.config["MONGO_URI"] = "mongodb://localhost:27018/modelhubdb"

mongo = PyMongo(app)

Expand Down
5 changes: 3 additions & 2 deletions model_hub/db/impl/mongo_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ async def close_database_connection(self):
async def get_models(self) -> List[Model]:
models_list = []
models_q = self.db.models.find()
async for post in models_q:
models_list.append(Model(**post, id=post["model_url"]))
print('models_q='+str(models_q))
async for model in models_q:
models_list.append(Model(**model, id=model["_id"]))
return models_list

async def get_model(self, model_url: str) -> Model:
Expand Down