HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name':
Hello,I am trying to read the hf model directly from s3 on sagemaker studio. I am getting ‘HFValidationError’ error. I am putting my code below:`from transformers import T5Tokenizer, T5ForConditionalGenerationSpecify the S3 URL to your model and tokenizermodel_url = “s3://bucketname/model/”Load the model and tokenizer from S3tokenizer = T5Tokenizer.from_pretrained(model_url)model = T5ForConditionalGeneration.from_pretrained(model_url)Now you can use the model and tokenizer for inferenceinput_text = “translate English to German: How old are you?”input_ids = tokenizer(input_text, return_tensors=“pt”, truncation=True, padding=True, max_length=512)input_ids.to(“cuda”)outputs = model.generate(input_ids)print(tokenizer.decode(outputs[0]))`I am able to see the model by running below code on sagemaker, so i am sure the path is correct.`s3 = boto3.client(‘s3’)List all objects in the model folder from S3s3_resource = boto3.resource(‘s3’)my_bucket = s3_resource.Bucket(bucket_name)for object_summary in my_bucket.objects.filter(Prefix=‘’):file_path = object_summary.keyfile_name = os.path.basename(file_path)if file_name:print(file_name)`Can you please help me? Thanks
2023-11-09T07:40:22Z
I need help with this too!