Skip to content

A ~9M parameter LLM that talks like a small fish.

Python

Fix code quality issues

Test User627679331191
diff --git a/guppylm/__main__.py b/guppylm/__main__.py
index f69761c..f31037b 100644
--- a/guppylm/__main__.py
+++ b/guppylm/__main__.py
@@ -1,4 +1,4 @@
-"""Entry point for: python -m guppyllm"""
+"""Entry point for: python -m guppylm"""
import os
import sys
diff --git a/guppylm/inference.py b/guppylm/inference.py
index 023c71e..b706d46 100644
--- a/guppylm/inference.py
+++ b/guppylm/inference.py
@@ -1,6 +1,7 @@
"""GuppyLM inference — simple chat."""
import json
+import os
import time
import uuid
@@ -16,7 +17,6 @@ class GuppyInference:
self.device = torch.device(device)
self.tokenizer = Tokenizer.from_file(tokenizer_path)
- import os
ckpt = torch.load(checkpoint_path, map_location=self.device, weights_only=False)
# Load config.json from same directory as the model file
diff --git a/tools/export_onnx.py b/tools/export_onnx.py
index 2a326ae..0fdc1c2 100644
--- a/tools/export_onnx.py
+++ b/tools/export_onnx.py
@@ -18,7 +18,11 @@ import json
import os
import sys
+import torch
+
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "guppylm"))
+from config import GuppyConfig
+from model import GuppyLM
def load_env():
@@ -35,10 +39,6 @@ def load_env():
def export_onnx(checkpoint_path, tokenizer_path, output_path, quantize=True, push=False):
import shutil
- import torch
- from config import GuppyConfig
- from model import GuppyLM
-
# Load checkpoint
ckpt = torch.load(checkpoint_path, map_location="cpu", weights_only=False)