"docs/git@developer.sourcefind.cn:OpenDAS/pytorch3d.git" did not exist on "4d8f132a78c47de7b9d9d69920a6544d8f788bf6"
Commit 51164f57 authored by Jeffrey Morgan's avatar Jeffrey Morgan
Browse files

add `GET /models` endpoint

parent 6ba93652
...@@ -74,6 +74,12 @@ def generate(): ...@@ -74,6 +74,12 @@ def generate():
stream_with_context(stream_response()), mimetype="text/event-stream" stream_with_context(stream_response()), mimetype="text/event-stream"
) )
@app.route("/models", methods=["GET"])
def models():
all_files = os.listdir("./models")
bin_files = [file.replace(".bin", "") for file in all_files if file.endswith(".bin")]
return Response(json.dumps(bin_files), mimetype="application/json")
if __name__ == "__main__": if __name__ == "__main__":
app.run(debug=True, threaded=True, port=5001) app.run(debug=True, threaded=True, port=5001)
app.run() app.run()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment