Trickshotblaster commited on
Commit
ad590a4
·
1 Parent(s): 70d8b6d
Files changed (3) hide show
  1. __pycache__/gpt.cpython-310.pyc +0 -0
  2. gpt.py +3 -3
  3. mike-code-15k.pth +2 -2
__pycache__/gpt.cpython-310.pyc CHANGED
Binary files a/__pycache__/gpt.cpython-310.pyc and b/__pycache__/gpt.cpython-310.pyc differ
 
gpt.py CHANGED
@@ -134,7 +134,7 @@ my_GPT = load_compiled_model_state_dict(my_GPT, 'latest_model_finetune.pth')
134
  #my_GPT.load_state_dict(torch.load('latest_model_finetune.pth', map_location=torch.device('cpu')))
135
  my_GPT.eval()
136
 
137
- my_GPT_code = GPT(enc.n_vocab, block_size, n_layers, n_heads, d_model, dropout=0.1) #enc.n_vocab
138
  my_GPT_code = my_GPT_code.to(device)
139
  #my_GPT = torch.compile(my_GPT, mode='reduce-overhead')
140
  my_GPT_code = load_compiled_model_state_dict(my_GPT_code, 'mike-code-15k.pth')
@@ -153,8 +153,8 @@ def get_response(in_text, top_k=50, temperature=1, model="mike-chat"):
153
  prompt = "USER: " + in_text + "\nASSISTANT: "
154
  input_tokens = enc.encode(prompt)
155
  output_tokens = enc.encode(prompt)
156
- for x in range(block_size):
157
- if len(input_tokens) > block_size:
158
  input_tokens = input_tokens[1:]
159
  context_tensor = torch.tensor(input_tokens).view(1, -1).to(device)
160
 
 
134
  #my_GPT.load_state_dict(torch.load('latest_model_finetune.pth', map_location=torch.device('cpu')))
135
  my_GPT.eval()
136
 
137
+ my_GPT_code = GPT(enc.n_vocab, 256, n_layers, n_heads, d_model, dropout=0.1) #enc.n_vocab
138
  my_GPT_code = my_GPT_code.to(device)
139
  #my_GPT = torch.compile(my_GPT, mode='reduce-overhead')
140
  my_GPT_code = load_compiled_model_state_dict(my_GPT_code, 'mike-code-15k.pth')
 
153
  prompt = "USER: " + in_text + "\nASSISTANT: "
154
  input_tokens = enc.encode(prompt)
155
  output_tokens = enc.encode(prompt)
156
+ for x in range(models[model].block_size):
157
+ if len(input_tokens) > models[model].block_size:
158
  input_tokens = input_tokens[1:]
159
  context_tensor = torch.tensor(input_tokens).view(1, -1).to(device)
160
 
mike-code-15k.pth CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:3a3f92898af4acb8f41a571e6a4f2b597b7cca1316120787f51cb8d11ba84977
3
- size 650652710
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:90941b8a7e50c178025368ba12120d700c1a4d7e84e39541d54c1e06a50d96ab
3
+ size 649866278