burhan112 commited on
Commit
a3376e7
·
verified ·
1 Parent(s): 84008c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -136,11 +136,11 @@ class Transformer(nn.Module):
136
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
137
 
138
  # Load tokenizers
139
- sp_pseudo = spm.SentencePieceProcessor(model_file="pseudo.model") # For decoding pseudocode (target)
140
- sp_code = spm.SentencePieceProcessor(model_file="code.model") # For encoding C++ (source)
141
 
142
  # Load the full saved model (architecture + weights)
143
- model_path = "transformer_cpp_to_pseudo.pth"
144
  model = torch.load(model_path, map_location=device, weights_only=False)
145
  model.eval()
146
  model = model.to(device)
 
136
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
137
 
138
  # Load tokenizers
139
+ sp_pseudo = spm.SentencePieceProcessor(model_file="pseudocode_tokenizer.model") # For decoding pseudocode (target)
140
+ sp_code = spm.SentencePieceProcessor(model_file="code_tokenizer.model") # For encoding C++ (source)
141
 
142
  # Load the full saved model (architecture + weights)
143
+ model_path = "code2pseudo.pth"
144
  model = torch.load(model_path, map_location=device, weights_only=False)
145
  model.eval()
146
  model = model.to(device)