-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pythonrc.py
More file actions
35 lines (29 loc) · 1.02 KB
/
.pythonrc.py
File metadata and controls
35 lines (29 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import importlib
import torch
from torch import Tensor, nn
import numpy as np
import pandas as pd
import readline
import os
import atexit
import models.transformers
from models.transformers import Transformer, MultiHeadAttention
from models.transformers import TransformerEncoder, TransformerEncoderLayer
from models.transformers import TransformerDecoder, TransformerDecoderLayer
from models.transformers import NLPTransformer
from models.transformers import LanguageModelingHead
from transformers import AutoTokenizer
import datasets
from datasets import CSVDataset
import utils
from utils import download_wandb_checkpoint, load_model_from_wandb_checkpoint
print("Python interactive shell started with default imports!")
# Point to the history file in the mounted volume
histfile = os.path.join("/mnt/history", ".python_history")
# Load the history if the file exists
try:
readline.read_history_file(histfile)
except FileNotFoundError:
pass
# Save the history on exit
atexit.register(readline.write_history_file, histfile)