Using Google Colab Notebook

To use Google Colab Notebook click on the following link:

Steps to run the Google Colab Notebook

  1. To connect to a runtime, click on the connect button on the upper-right corner as shown in the following:

  2. Choose the preferred runtime by clicking Runtime>Change runtime type.

  3. After connecting to your runtime, there are two ways to continue:

    • You can connect to the normal runtime, which is free and consumes the least amount of Google-provided resources.
    • You can connect to the GPU-accelerated runtime, which comes with certain limitations and has a time limit (if using the free version of Google Colab).
  4. Run the first code block under the install the required libraries section, by clicking the play button marked in red to execute the code block, as shown in the following screenshot:

  5. After selecting your preferred runtime and executing the first code block, there are two options:

    • If normal runtime is selected, execute the following code block:

    • If GPU accelerated runtime is selected, execute the following code block:

      NOTE: Depending on your preferred runtime, you can run only one of these code blocks.

  6. Using the GPU runtime can decrease the time taken to generate the description, title or keywords.

  7. Execute the import the libraries code block similar to the above.

  8. Execute the downloading and loading the model code blocks similar to the above.

  9. Under user credentials code block, input your host address, port number and username and password inside the auth() variable. Enter the desired collection id for the index_name variable as shown in the following example:

  10. Execute the checking cluster health code block.

  11. Execute the retrieving and cleaning the data code block.

  12. Execute the prompts for the desired outputs code block.

  13. Execute the Generating the relevant output and pushing it onto the metadata code block.



To check the results of the above mentioned code blocks, follow steps 10-13 from the page Using Python .