Skip to content

feat(server): log inferred Torch device during server startup#14

Merged
david20571015 merged 1 commit intomainfrom
logging
Mar 12, 2025
Merged

feat(server): log inferred Torch device during server startup#14
david20571015 merged 1 commit intomainfrom
logging

Conversation

@david20571015
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings March 12, 2025 09:37
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @david20571015, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

This pull request introduces a new feature to log the inferred Torch device during the server startup process. This enhancement helps in debugging and monitoring the server's environment by providing explicit information about the device being used for Torch operations. The changes involve importing the infer_torch_device function from llama_index.core.utils and adding a log message to display the inferred device during server initialization.

Highlights

  • Feature: Logs the inferred Torch device during server startup.
  • Import: Imports infer_torch_device from llama_index.core.utils.
  • Logging: Adds a log message to display the inferred Torch device.

Changelog

  • scripts/serve.py
    • Imported infer_torch_device from llama_index.core.utils.
    • Added a log message to display the inferred Torch device during server startup using logger.info("Torch device: %s", infer_torch_device()).
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


Trivia time!

What is the primary purpose of the PyTorch library?

Click here for the answer
PyTorch is primarily used for building and training neural networks and other machine learning models. It provides tools and functions for tensor computations, automatic differentiation, and model deployment.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@david20571015 david20571015 merged commit 872f1e8 into main Mar 12, 2025
1 check passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the server startup logging by recording the inferred Torch device, and improves logging consistency during server shutdown.

  • Imported the infer_torch_device utility from llama_index.core.utils.
  • Logged the Torch device information during server startup.
  • Replaced a call to logging.info with the provided logger instance for consistency in the graceful shutdown function.

@david20571015 david20571015 deleted the logging branch March 12, 2025 09:37
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request introduces logging for the inferred Torch device during server startup, which is helpful for debugging and monitoring. The changes are straightforward and seem well-implemented.

Merge Readiness

The code changes are simple and introduce a helpful logging feature. I don't see any immediate issues that would block merging. However, as I am unable to directly approve the pull request, please have others review and approve this code before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants