gptmodel 1.0.6__py3-none-any.whl → 1.0.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
gptmodel/gptmodel.py CHANGED
@@ -340,7 +340,7 @@ class GPTModel:
340
340
  'embedding_dim': max((1, int(self.__embedding_dim))) if type(self.__embedding_dim) in (bool, int, float) else -1,
341
341
  'vocab_size': max((0, int(self.__vocab_size))) if type(self.__vocab_size) in (bool, int, float) else 0,
342
342
  'block_size': max((1, int(self.__block_size))) if type(self.__block_size) in (bool, int, float) else -1,
343
- 'end_tag': str(self.__end_tag) if type(self.__end_tag) is not None else '',
343
+ 'end_tag': str(self.__end_tag) if self.__end_tag is not None else '',
344
344
  'number_heads': max((1, int(self.__number_heads))) if type(self.__number_heads) in (bool, int, float) else -1,
345
345
  'number_layers': max((1, int(self.__number_layers))) if type(self.__number_layers) in (bool, int, float) else -1,
346
346
  'dropout': max((0, int(self.dropout))) if type(self.dropout) in (bool, int, float) else 0.1,
@@ -375,7 +375,9 @@ class GPTModel:
375
375
  for _ in self.__tqdm(range(10), desc='Loading model', leave=False):
376
376
  try: checkpoint = self.__load(model_file, map_location=self.__device)
377
377
  except: checkpoint = self.__load(model_file)
378
- else: checkpoint = self.__load(model_file, map_location=self.__device)
378
+ else:
379
+ try: checkpoint = self.__load(model_file, map_location=self.__device)
380
+ except: checkpoint = self.__load(model_file)
379
381
  try: self.__tokenizer = str(checkpoint['tokenizer']).lower().strip()
380
382
  except: self.__tokenizer = 'gpt'
381
383
  try: self.__embedding_dim = max((1, int(checkpoint['embedding_dim']))) if checkpoint['embedding_dim'] != -1 else None
@@ -1,14 +1,14 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: gptmodel
3
- Version: 1.0.6
3
+ Version: 1.0.8
4
4
  Home-page: https://github.com/sapiens-technology/gptmodel
5
5
  Author: SAPIENS TECHNOLOGY
6
6
  License: Proprietary Software
7
7
  License-File: LICENSE.txt
8
- Requires-Dist: torch==2.4.1
9
- Requires-Dist: numpy==1.25.2
10
- Requires-Dist: tiktoken==0.4.0
11
- Requires-Dist: tqdm==4.67.1
8
+ Requires-Dist: torch
9
+ Requires-Dist: numpy
10
+ Requires-Dist: tiktoken
11
+ Requires-Dist: tqdm
12
12
  Dynamic: author
13
13
  Dynamic: home-page
14
14
  Dynamic: license
@@ -0,0 +1,7 @@
1
+ gptmodel/__init__.py,sha256=ifnJnBPHcBZwiHgt_mNp9gd1OJYCCHB3bgml6TmKBIw,1358
2
+ gptmodel/gptmodel.py,sha256=C5S8f-TI6WZxN3BtZbs7ANEeIxu6NbvEzMh070IFQVQ,33584
3
+ gptmodel-1.0.8.dist-info/LICENSE.txt,sha256=WqB2vIA5tH5lqLTr53yT_oy1m0wYfuvCPQKxdDHWimg,115
4
+ gptmodel-1.0.8.dist-info/METADATA,sha256=V6fZe-JFauZ7isHexJ71qQchVe90QAKP6JUX6O8ROrw,354
5
+ gptmodel-1.0.8.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
6
+ gptmodel-1.0.8.dist-info/top_level.txt,sha256=585C0QclguIkVPKKPpoeD2FxYAc5n5EAuvJNK4vMeQk,9
7
+ gptmodel-1.0.8.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- gptmodel/__init__.py,sha256=ifnJnBPHcBZwiHgt_mNp9gd1OJYCCHB3bgml6TmKBIw,1358
2
- gptmodel/gptmodel.py,sha256=rJqV2Pbk7lRati9sqj4hEHUyqPFfjQu6eWYkq4T2sPw,33508
3
- gptmodel-1.0.6.dist-info/LICENSE.txt,sha256=WqB2vIA5tH5lqLTr53yT_oy1m0wYfuvCPQKxdDHWimg,115
4
- gptmodel-1.0.6.dist-info/METADATA,sha256=oUIv3Mn6VM2SgqLQ6xLv6F95nsfOrNBFWQ_nLCK8B-c,384
5
- gptmodel-1.0.6.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
6
- gptmodel-1.0.6.dist-info/top_level.txt,sha256=585C0QclguIkVPKKPpoeD2FxYAc5n5EAuvJNK4vMeQk,9
7
- gptmodel-1.0.6.dist-info/RECORD,,