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

Add support for Sagemaker endpoint #326

Closed
wants to merge 4 commits into from

Conversation

user-10389
Copy link

No description provided.

@user-10389
Copy link
Author

Hey, added support for sagemaker endpoint. In .env.local, if host argument (in model endpoints) is set to "aws", user must provide the url to his sagemaker endpoint along with the access_key, secret_access_key and region (in the .env.local file just like HF_token), if not host is provided code behaves the same as before.

@user-10389 user-10389 changed the title Sagemaker endpoint Add support for Sagemaker endpoint Jun 28, 2023
@nsarrazin nsarrazin self-assigned this Jun 28, 2023
@nsarrazin nsarrazin self-requested a review June 28, 2023 11:52
@nsarrazin
Copy link
Collaborator

Hi, thank you for your contribution! I think supporting multiple endpoints is a super valuable feature and I appreciate that you tackled it!

I just want to make sure we do it in a way that's modular so we can scale to supporting even more endpoints in the future, so I'll try to have a look at how we can do this and then we can merge your work into that framework.

@rrfaria
Copy link

rrfaria commented Aug 1, 2023

Perhaps, instead of loading an entire library just for formatting UTC, you could consider using:

function getFormattedDate(format) {
  const now = new Date();
  const year = now.getUTCFullYear();
  const month = String(now.getUTCMonth() + 1).padStart(2, '0');
  const day = String(now.getUTCDate()).padStart(2, '0');
  const hours = String(now.getUTCHours()).padStart(2, '0');
  const minutes = String(now.getUTCMinutes()).padStart(2, '0');
  const seconds = String(now.getUTCSeconds()).padStart(2, '0');

  let formattedDate = format
    .replace("yyyy", year)
    .replace("MM", month)
    .replace("DD", day)
    .replace("HH", hours)
    .replace("mm", minutes)
    .replace("ss", seconds);

  return formattedDate;
}

const customFormat = "yyyyMMDD"; 
const formattedDate = getFormattedDate(customFormat);
console.log(formattedDate);

I hope it could help

@philschmid
Copy link
Member

@nsarrazin any timeline on when this would be available?

@nsarrazin
Copy link
Collaborator

Hi! Thanks for the contribution. We ended up adding support with #401 because there were a few extra steps needed to get AWS working right. I'm gonna close this PR therefore, but feel free to let me know if we missed something in the other PR

@nsarrazin nsarrazin closed this Aug 17, 2023
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.

4 participants