Skip to content

Commit

Permalink
Model Files Update
Browse files Browse the repository at this point in the history
  • Loading branch information
KalyanMurapaka45 committed Mar 21, 2024
1 parent 90299bc commit 19d53de
Show file tree
Hide file tree
Showing 18 changed files with 62 additions and 905 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/aws.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Deploy Application Docker Image to EC2 instance

on:
push:
branches: [main]

jobs:
Continuous-Integration:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: ${{ secrets.ECR_REPO }}
IMAGE_TAG: latest
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
Continuous-Deployment:
needs: Continuous-Integration
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Run Docker Image to serve users
run: |
docker run -d -e AWS_ACCESS_KEY_ID="${{ secrets.AWS_ACCESS_KEY_ID }}" -e AWS_SECRET_ACCESS_KEY="${{ secrets.AWS_SECRET_ACCESS_KEY }}" -e AWS_DEFAULT_REGION="${{ secrets.AWS_DEFAULT_REGION }}" -e MONGODB_URL="${{ secrets.MONGODB_URL }}" -p 8080:8080 "${{ steps.login-ecr.outputs.registry }}"/"${{ secrets.ECR_REPO }}":latest
6 changes: 3 additions & 3 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
kidney_model = load_model('Artifacts\Kidney_Disease\Kidney_Model.h5')
#lung_model = load_model('Artifacts\Lung_Disease\Lung_Model.h5')
livermodel = pickle.load(open('Artifacts\Liver_Disease\Liver_Model.pkl', 'rb'))
liverpreprocessor = pickle.load(open('Artifacts\Liver_Disease\Liver_Preprocessor.pkl', 'rb'))
#liverpreprocessor = pickle.load(open('Artifacts\Liver_Disease\Liver_Preprocessor.pkl', 'rb'))



Expand Down Expand Up @@ -264,8 +264,8 @@ def liver():
albumin, albumin_globulin_ratio]).reshape(1, -1)

# Make prediction - (livermodel and liverpreprocessor assumed to be defined elsewhere)
prediction = livermodel.predict(liverpreprocessor.transform(features))[0]
probability = livermodel.predict_proba(liverpreprocessor.transform(features))[0][1]
prediction = livermodel.predict(features)[0]
probability = livermodel.predict_proba(features)[0][1]

# Prepare response
if prediction == 1:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_gemini_response(question):
response = model.generate_content(question)
return response.text

st.title('GeminiMed: GPT-4.5')
st.title('OpenHealth: GPT-4.5')

user_input = st.text_input("Enter Your Medical Query Here:")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ def validate(validation_prompt):
uploaded_file = st.file_uploader("Upload an image", type=['jpg', 'png', 'jpeg'])
if uploaded_file is not None:
image = Image.open(uploaded_file)
st.image(image, caption='Uploaded Image.', use_column_width=True)
response_text = gen_image(question, image)
st.write(response_text)
163 changes: 0 additions & 163 deletions src/gen_ai/.gitignore

This file was deleted.

21 changes: 0 additions & 21 deletions src/gen_ai/LICENSE

This file was deleted.

This file was deleted.

Loading

0 comments on commit 19d53de

Please sign in to comment.