From 92297d8ea2900fd1a3bbabaae0a9ae69c5a14da7 Mon Sep 17 00:00:00 2001 From: hnu202409060624 <2804411502@qq.com> Date: Tue, 31 Dec 2024 12:54:26 +0800 Subject: [PATCH] ADD file via upload --- config.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 config.py diff --git a/config.py b/config.py new file mode 100644 index 0000000..aeec0a6 --- /dev/null +++ b/config.py @@ -0,0 +1,26 @@ +import json + +import torch + +with open('vocab/vocabulary.json', 'r', encoding='utf-8') as f: + vocab = json.load(f) + vocab_size = len(vocab) +with open('vocab/sm_voc.json', 'r', encoding='utf-8') as f: + sm_size = len(json.load(f)) + +batch_size=1 +input_dim=1024 +embedding_dim=input_dim +dropout=0.1 +n_head=32 +Encoder_n_layers=1 +d_ff1=input_dim*4 +d_ff2=input_dim*4 +Decoder_n_layer=0 +hidden_dim=input_dim +seq_len=30 +kernal_size=seq_len*2 +stride=2 +bias=True +device=torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu') +print(f'cuda available:{torch.cuda.is_available()}') \ No newline at end of file