Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up Summarize test #19

Merged
merged 2 commits into from
Oct 21, 2024
Merged

Speed up Summarize test #19

merged 2 commits into from
Oct 21, 2024

Conversation

fayvor
Copy link
Contributor

@fayvor fayvor commented Oct 21, 2024

#149

  • Take a default value for get_env_var() and set_env_var(), so we can use them to retrieve GRANITE_TESTING and others.

PR Checklist

  • Commits signed: All commits must be GPG or SSH signed.
  • DCO Compliance: Developer Certificate of Origin (DCO) applies to the code, documentation, and any example data provided. Ensure commits are signed off.
  • Notebook outputs cleared: Ensure all notebook outputs are cleared.
  • Automated testing: Add the recipe to the automated tests.
  • Test in Google Colab:
    • Test that it works in Google Colab (Python 3.10.12).
    • Colab has its own package set and Python version, so ensure compatibility.
  • Test locally:
    • Ensure the code works in a fresh Python virtual environment (venv).
  • Flexible LLM platform support:
    • The platform should be easily switchable. Use LangChain for now.
    • Include !pip install git+https://github.com/ibm-granite-community/granite-kitchen in the instructions.
  • Example data: Follow the example data guidance.
  • README.md updates:
    • Add a link to the recipe in the Table of Contents (ToC).
    • Include a Colab button after that link.

@@ -39,7 +39,12 @@ def get_env_var(var_name):
print(f"{var_name} not found in .env file.")

if not env_var:
# If neither Colab nor .env file, prompt the user for the API key
# If we can't find a value in the env, use the default value if provided.
if default_value is not None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is a lot of code that could just be handled in one line:

env_var = os.environ.get(var_name, default_value)

Copy link
Contributor

Choose a reason for hiding this comment

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

@fayvor Since this is blocking tests passing, let's get this in, and come back to @rawkintrevo's point

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rawkintrevo I'm not sure what you are suggesting, sorry. That line doesn't have the same outcome.

@@ -39,7 +39,12 @@ def get_env_var(var_name):
print(f"{var_name} not found in .env file.")

if not env_var:
# If neither Colab nor .env file, prompt the user for the API key
# If we can't find a value in the env, use the default value if provided.
if default_value is not None:
Copy link
Contributor

Choose a reason for hiding this comment

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

@fayvor Since this is blocking tests passing, let's get this in, and come back to @rawkintrevo's point

@adampingel
Copy link
Contributor

@rawkintrevo @fayvor To look at the utils package closer: #20

@adampingel adampingel merged commit c7d2f8e into main Oct 21, 2024
4 checks passed
@adampingel adampingel deleted the 149-speed-up-summarize-test branch October 21, 2024 21:33
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.

3 participants