This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sagemaker | |
import json | |
from sagemaker import get_execution_role | |
import boto3 | |
# Role to have access of reading and write inside S3 | |
role = get_execution_role() | |
# Path files | |
train_path='s3://topicmodeling/train/base_treino.csv' |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import copy | |
from torch import nn | |
from transformers import T5PreTrainedModel | |
from transformers.models.t5.modeling_t5 import T5Stack | |
from transformers.modeling_outputs import SequenceClassifierOutput | |
from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss | |
def mean_pooling(inputs, mask): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from transformers import AutoModel, AutoTokenizer | |
from transformers import AutoModelForCausalLM | |
import torch | |
import torch.nn.functional | |
from tqdm.auto import tqdm | |
from nltk.translate.bleu_score import sentence_bleu | |
import pandas as pd | |
import numpy as np | |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.