Giter Club home page Giter Club logo

ml-project's Introduction

ML

ML Engineer Vetting Project

The goal of this project is to create a machine learning model capable of receiving text describing a clothing item and returning a ranked list of links to similar items from different websites. Your solution must be a function deployed on Google Cloud that accepts a text string and returns JSON responses with ranked suggestions.

Steps to be followed to deploy docker image on Gogle Cloud Run

Libraries(if you are using editor like Vscode )

pip install pandas
pip install numpy
pip install TfidfVectorizer
pip install cosine_similarity
pip install transformers

To containerize the application using Docker and deploy it on Google Cloud Functions or Google Cloud Run, you can follow these steps:

Build the Docker image:

Open a terminal or command prompt and navigate to the project directory. Run the following command to build the Docker image:

docker build -t myapp .

Note: Replace myapp with a suitable name for your Docker image.

Test the Docker image:

You can test the Docker image locally by running the following command:

docker run -p 8080:8080 myapp

This will start the container and map the container's port 8080 to your local machine's port 8080. You can send a test request to http://localhost:8080/ to verify if the application is working correctly.

Upload the Docker image to a container registry:

You need to upload the Docker image to a container registry in order to deploy it on Google Cloud Functions or Google Cloud Run. Here's an example of how to upload the Docker image to Google Container Registry (GCR):

a) Tag the Docker image with the GCR location:

docker tag myapp gcr.io/[PROJECT_ID]/myapp

Replace [PROJECT_ID] with your Google Cloud project ID.

b. Authenticate Docker with GCR:

docker login -u _json_key -p "$(cat key.json)" https://gcr.io

Replace key.json with the path to your Google Cloud service account key file. This step authenticates Docker with GCR using the service account credentials.

c. Push the Docker image to GCR:

docker push gcr.io/[PROJECT_ID]/myapp

Deploy on Google Cloud Run:

To deploy the container on Google Cloud Run, follow these steps:

i. Open the Cloud Run page in the Google Cloud Console.

ii. Click "Create Service" to create a new service.

iii. Provide a service name and choose your preferred region.

iv. Under "Container image", select "Custom".

v. Enter the container image URL in the "Container image URL" field (e.g., gcr.io/[PROJECT_ID]/myapp).

vi. Set the "Memory allocated" and "Maximum requests per container" according to your requirements.

vii. Click "Create" to deploy the service.

Test the deployed function: After the deployment is successful, you can test the function by sending a JSON payload with the input text to the provided endpoint URL. The function will return a JSON response with the ranked list of similar item URLs. Make sure to replace [PROJECT_ID] and the endpoint URL with your actual project ID and function/service endpoint URL.

That's it! You have containerized the application using Docker and deployed it on Google Cloud Functions or Google Cloud Run, enabling it to accept JSON payloads and return JSON responses with the ranked list of similar item URLs.

image

image

image

image

image

ml-project's People

Contributors

mansijain980 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.