Skip to content

Commit

Permalink
issue #51: Add default value to MAX_CONTENT_LENGTH
Browse files Browse the repository at this point in the history
issue #51: Give MAX_CONTENT_LENGTH default value

issue #51: Remove legacy folder
  • Loading branch information
Maxence Guindon committed Apr 8, 2024
1 parent 342aba5 commit cac2883
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 91 deletions.
10 changes: 8 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,20 @@
connection_string_regex = r"^DefaultEndpointsProtocol=https?;.*;FileEndpoint=https://[a-zA-Z0-9]+\.file\.core\.windows\.net/;$"
connection_string = os.getenv("NACHET_AZURE_STORAGE_CONNECTION_STRING")


FERNET_KEY = os.getenv("NACHET_BLOB_PIPELINE_DECRYPTION_KEY")
PIPELINE_VERSION = os.getenv("NACHET_BLOB_PIPELINE_VERSION")
PIPELINE_BLOB_NAME = os.getenv("NACHET_BLOB_PIPELINE_NAME")

NACHET_DATA = os.getenv("NACHET_DATA")
NACHET_MODEL = os.getenv("NACHET_MODEL")

try:
MAX_CONTENT_LENGTH = int(os.getenv("NACHET_MAX_CONTENT_LENGTH"))
except TypeError:
MAX_CONTENT_LENGTH = 16


Model = namedtuple(
'Model',
[
Expand All @@ -54,8 +61,7 @@
}
app = Quart(__name__)
app = cors(app, allow_origin="*", allow_methods=["GET", "POST", "OPTIONS"])
app.config["MAX_CONTENT_LENGTH"] = 200 * 1024 * 1024 # 200 MB

app.config["MAX_CONTENT_LENGTH"] = MAX_CONTENT_LENGTH * 1024 * 1024


@app.post("/del")
Expand Down
13 changes: 0 additions & 13 deletions docs/nachet-model-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,6 @@ The inference and API call functions act as entry and exit points for the model.

We decided to named the top results property top N because this value can return n predictions. Usually in AI, the top 5 result are use to measure the accuracy of a model. If the correct result is the top 5, then it is considered that the prediction was true.

This is useful in case were the user have is attention on more then 1 result.

> "Top N accuracy — Top N accuracy is when you measure how often your predicted class falls in the top N values of your softmax distribution."
[Nagda, R. (2019-11-08) *Evaluating models using the Top N accuracy metrics*. Medium](https://medium.com/nanonets/evaluating-models-using-the-top-n-accuracy-metrics-c0355b36f91b)

### Why topN

We decided to named the top results property top N because this value can return n predictions. Usually in AI, the top 5 result are use to measure the accuracy of a model. If the correct result is the top 5, then it is considered that the prediction was true.

This is useful in case were the user have is attention on more then 1 result.

> "Top N accuracy — Top N accuracy is when you measure how often your predicted class falls in the top N values of your softmax distribution."
Expand All @@ -104,7 +95,6 @@ The `box` key stores the value for a specific box around a seed. This helps the

![image](https://github.com/ai-cfia/nachet-backend/assets/96267006/469add8d-f40a-483f-b090-0ebcb7a8396b)


## Different ways of calling models

### Header
Expand Down Expand Up @@ -185,9 +175,6 @@ models:
inference_function:
content-type:
deployment_platform:
# example of deployment_platform:
# - azure: name_of_endpoint
# support azure, google, huggingface, aws
endpoint_name:
model_name:
created_by:
Expand Down
Empty file removed model_inference/__init__.py
Empty file.
76 changes: 0 additions & 76 deletions model_utilitary_functions/model_UTILS.py

This file was deleted.

0 comments on commit cac2883

Please sign in to comment.