Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Fix safetensors numpy/torch submodule imports #1204

Evhye38496ba1693480e0d
diff --git a/src/python/txtai/util/library.py b/src/python/txtai/util/library.py
index f1c6e46c..c3056110 100644
--- a/src/python/txtai/util/library.py
+++ b/src/python/txtai/util/library.py
@@ -212,6 +212,10 @@ class Library:
try:
import safetensors
+ # Import submodules - they are not auto-imported with safetensors
+ import safetensors.numpy
+ import safetensors.torch
+
except ImportError:
class Safetensors: