fahmiaziz98 commited on
Commit
7312439
·
1 Parent(s): b620d4a

frist commit

Browse files
router/disaster.py CHANGED
@@ -7,7 +7,8 @@ from utils.pipeline import load_model
7
 
8
  router = APIRouter()
9
 
10
- MODEL_PATH = "ml_models/tinybert-disaster-tweet/"
 
11
 
12
  @router.post(
13
  "/disaster_classification",
 
7
 
8
  router = APIRouter()
9
 
10
+ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
11
+ MODEL_PATH = os.path.join(BASE_DIR, "ml-models", "tinybert-disaster-tweet/")
12
 
13
  @router.post(
14
  "/disaster_classification",
router/image_clf.py CHANGED
@@ -7,7 +7,8 @@ from utils.pipeline import load_model
7
 
8
  router = APIRouter()
9
 
10
- MODEL_PATH = "ml_models/vit-human-pose-classification/"
 
11
 
12
  @router.post(
13
  "/image_classification",
 
7
 
8
  router = APIRouter()
9
 
10
+ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
11
+ MODEL_PATH = os.path.join(BASE_DIR, "ml-models", "vit-human-pose-classification/")
12
 
13
  @router.post(
14
  "/image_classification",
router/sentiment.py CHANGED
@@ -7,7 +7,8 @@ from utils.pipeline import load_model
7
 
8
  router = APIRouter()
9
 
10
- MODEL_PATH = "ml_models/tinybert-sentiment-analysis/"
 
11
 
12
  @router.post(
13
  "/sentiment_classification",
 
7
 
8
  router = APIRouter()
9
 
10
+ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
11
+ MODEL_PATH = os.path.join(BASE_DIR, "ml-models", "tinybert-sentiment-analysis/")
12
 
13
  @router.post(
14
  "/sentiment_classification",
scripts/s3.py CHANGED
@@ -3,9 +3,9 @@ import boto3
3
  from pathlib import Path
4
  from utils.log import logger
5
 
6
- aws_access_key = os.getenv("AWS_ACCESS_KEY_ID") #"AKIA2ZIOMY3VPQVDJNDG"
7
- aws_key_pw = os.getenv("AWS_SECRET_ACCESS_KEY") #"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"
8
- BUCKET_NAME = os.getenv("BUCKET_NAME") #"mlops-tiny-bert-19032025"
9
  s3 = boto3.client(
10
  "s3",
11
  aws_access_key_id=aws_access_key,
 
3
  from pathlib import Path
4
  from utils.log import logger
5
 
6
+ aws_access_key = os.getenv("AWS_ACCESS_KEY_ID")
7
+ aws_key_pw = os.getenv("AWS_SECRET_ACCESS_KEY")
8
+ BUCKET_NAME = os.getenv("BUCKET_NAME")
9
  s3 = boto3.client(
10
  "s3",
11
  aws_access_key_id=aws_access_key,