modif app pour recéuperer dernier version du modele
Browse files
app.py
CHANGED
|
@@ -91,7 +91,7 @@ s3 = boto3.client("s3")
|
|
| 91 |
def latest_model(bucket:str, prefix: str):
|
| 92 |
response = s3.list_objects_v2(Bucket=bucket, Prefix=prefix)
|
| 93 |
if "content" not in response:
|
| 94 |
-
raise FileNotFoundError(f"Aucun modèle trouvé")
|
| 95 |
latest = max(response["content"], key=lambda x: x["Last modified"])
|
| 96 |
return latest["Key"]
|
| 97 |
|
|
|
|
| 91 |
def latest_model(bucket:str, prefix: str):
|
| 92 |
response = s3.list_objects_v2(Bucket=bucket, Prefix=prefix)
|
| 93 |
if "content" not in response:
|
| 94 |
+
raise FileNotFoundError(f"Aucun modèle trouvé dans s3://{bucket}/{prefix}")
|
| 95 |
latest = max(response["content"], key=lambda x: x["Last modified"])
|
| 96 |
return latest["Key"]
|
| 97 |
|