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 typos in docstrings, comments and docs (#1486)

sarankumare83b53fe2a67
diff --git a/docs/embeddings/index.md b/docs/embeddings/index.md
index 40145e96..d1ca65ce 100644
--- a/docs/embeddings/index.md
+++ b/docs/embeddings/index.md
@@ -51,7 +51,7 @@ The example above sets a specific embeddings vector model via the [path](configu
embeddings = Embeddings()
```
-In this case, when loading and searching for data, the [default transformers vector model](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) is used to vectorize data. See the [model guide](../models) for current model recommentations.
+In this case, when loading and searching for data, the [default transformers vector model](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) is used to vectorize data. See the [model guide](../models) for current model recommendations.
## Index
diff --git a/docs/workflow/task/index.md b/docs/workflow/task/index.md
index a532085e..0c89865b 100644
--- a/docs/workflow/task/index.md
+++ b/docs/workflow/task/index.md
@@ -3,7 +3,7 @@
![task](../../images/task.png#only-light)
![task](../../images/task-dark.png#only-dark)
-Workflows execute tasks. Tasks are callable objects with a number of parameters to control the processing of data at a given step. While similar to pipelines, tasks encapsulate processing and don't perform signficant transformations on their own. Tasks perform logic to prepare content for the underlying action(s).
+Workflows execute tasks. Tasks are callable objects with a number of parameters to control the processing of data at a given step. While similar to pipelines, tasks encapsulate processing and don't perform significant transformations on their own. Tasks perform logic to prepare content for the underlying action(s).
A simple task is shown below.
diff --git a/examples/rag_quickstart.py b/examples/rag_quickstart.py
index 9db9603d..64468b5b 100644
--- a/examples/rag_quickstart.py
+++ b/examples/rag_quickstart.py
@@ -19,7 +19,7 @@ from txtai.pipeline import Textractor
# Step 1: Collect files from local directory
#
-# Defaults to "data". Set to whereever your files are.
+# Defaults to "data". Set to wherever your files are.
path = "data"
files = [os.path.join(path, f) for f in os.listdir(path) if os.path.isfile(os.path.join(path, f))]
diff --git a/src/python/txtai/agent/model.py b/src/python/txtai/agent/model.py
index 623cfaa3..a3f0be4b 100644
--- a/src/python/txtai/agent/model.py
+++ b/src/python/txtai/agent/model.py
@@ -96,7 +96,7 @@ class PipelineModel(Model):
# Get clean message list
messages = get_clean_message_list(messages, role_conversions=tool_role_conversions, flatten_messages_as_text=self.flatten_messages_as_text)
- # Ensure all roles are strings and not enums for compability across LLM frameworks
+ # Ensure all roles are strings and not enums for compatibility across LLM frameworks
for message in messages:
if "role" in message:
message["role"] = message["role"].value if isinstance(message["role"], Enum) else message["role"]
diff --git a/src/python/txtai/agent/tool/skill.py b/src/python/txtai/agent/tool/skill.py
index 04fa764e..4143e994 100644
--- a/src/python/txtai/agent/tool/skill.py
+++ b/src/python/txtai/agent/tool/skill.py
@@ -40,7 +40,7 @@ class SkillTool(Tool):
# pylint: disable=W0221
def forward(self, request):
"""
- Searchs the skill markdown for the best answer.
+ Searches the skill markdown for the best answer.
Args:
request: user request
diff --git a/src/python/txtai/ann/dense/ggml.py b/src/python/txtai/ann/dense/ggml.py
index 7b5ca42f..d8d0fa18 100644
--- a/src/python/txtai/ann/dense/ggml.py
+++ b/src/python/txtai/ann/dense/ggml.py
@@ -595,7 +595,7 @@ class GGMLTensors:
def chunk(self, queries):
"""
- Splits quries into separate batch sizes specified by size.
+ Splits queries into separate batch sizes specified by size.
Args:
queries: queries
diff --git a/src/python/txtai/database/base.py b/src/python/txtai/database/base.py
index 04a51d80..18f7e7c0 100644
--- a/src/python/txtai/database/base.py
+++ b/src/python/txtai/database/base.py
@@ -15,7 +15,7 @@ logger = logging.getLogger(__name__)
class Database:
"""
Base class for database instances. This class encapsulates a content database used for
- storing field content as dicts and objects. The database instance works in conjuction
+ storing field content as dicts and objects. The database instance works in conjunction
with a vector index to execute SQL-driven similarity search.
"""
diff --git a/src/python/txtai/embeddings/index/autoid.py b/src/python/txtai/embeddings/index/autoid.py
index 8ecb3728..cd150357 100644
--- a/src/python/txtai/embeddings/index/autoid.py
+++ b/src/python/txtai/embeddings/index/autoid.py
@@ -72,7 +72,7 @@ class AutoId:
Generates a UUID and return as a string.
Args:
- data: used with determistic algorithms (uuid3, uuid5)
+ data: used with deterministic algorithms (uuid3, uuid5)
Returns:
UUID string
diff --git a/src/python/txtai/graph/base.py b/src/python/txtai/graph/base.py
index 17fd5e28..f1c214be 100644
--- a/src/python/txtai/graph/base.py
+++ b/src/python/txtai/graph/base.py
@@ -531,7 +531,7 @@ class Graph:
# Set graph if available, otherwise create a new empty graph of the same type
graph = graph if graph else type(self)(self.config)
- # Initalize subgraph
+ # Initialize subgraph
graph.initialize()
nodeids = {node[0] if isinstance(node, tuple) else node for node in nodes}
diff --git a/src/python/txtai/graph/query.py b/src/python/txtai/graph/query.py
index baf08918..93315be1 100644
--- a/src/python/txtai/graph/query.py
+++ b/src/python/txtai/graph/query.py
@@ -151,7 +151,7 @@ class Query:
attribute = f"match_{x}"
clause = f"{node}.{attribute} > 0"
- # Replace placeholder with earch results
+ # Replace placeholder with search results
query = query.replace(f"{Query.SIMILAR}{x}", f"{clause}")
# Add uids and scores
diff --git a/src/python/txtai/pipeline/audio/signal.py b/src/python/txtai/pipeline/audio/signal.py
index a3e0a245..1ae6c920 100644
--- a/src/python/txtai/pipeline/audio/signal.py
+++ b/src/python/txtai/pipeline/audio/signal.py
@@ -54,7 +54,7 @@ class Signal:
# Transpose audio
audio = audio.T
- # Resample audio and tranpose back
+ # Resample audio and transpose back
samples = round(len(audio) * float(target) / rate)
audio = signal.resample(audio, samples).T
@@ -163,7 +163,7 @@ class Signal:
rate: sample rate
threshold: energy below this level will be considered silence, defaults to 1.0
leading: trim leading silence, defaults to True
- trailing: trim trailing silence, defauls to True
+ trailing: trim trailing silence, defaults to True
Returns:
audio with silence removed
diff --git a/src/python/txtai/pipeline/llm/huggingface.py b/src/python/txtai/pipeline/llm/huggingface.py
index b54d2b9a..1a8f2f3d 100644
--- a/src/python/txtai/pipeline/llm/huggingface.py
+++ b/src/python/txtai/pipeline/llm/huggingface.py
@@ -137,7 +137,7 @@ class HFLLM(HFPipeline):
# Set parameters for vision models and return
if self.pipeline.task == "image-text-to-text":
- # Maxlength has to be large enough to accomodate images
+ # Maxlength has to be large enough to accommodate images
defaults["max_length"] = max(maxlength, 2048)
# Set default token id
diff --git a/src/python/txtai/pipeline/text/crossencoder.py b/src/python/txtai/pipeline/text/crossencoder.py
index 108cbdb7..c41f8c7e 100644
--- a/src/python/txtai/pipeline/text/crossencoder.py
+++ b/src/python/txtai/pipeline/text/crossencoder.py
@@ -82,7 +82,7 @@ class CrossEncoder(Labels):
def function(self, scores, multilabel):
"""
- Applys an output transformation function based on value of multilabel.
+ Applies an output transformation function based on value of multilabel.
Args:
scores: input scores
diff --git a/src/python/txtai/scoring/base.py b/src/python/txtai/scoring/base.py
index 233b557a..d8e7b068 100644
--- a/src/python/txtai/scoring/base.py
+++ b/src/python/txtai/scoring/base.py
@@ -63,7 +63,7 @@ class Scoring:
def upsert(self, documents=None):
"""
- Convience method for API clarity. Calls index method.
+ Convenience method for API clarity. Calls index method.
Args:
documents: list of (id, dict|text|tokens, tags)
diff --git a/src/python/txtai/scoring/terms.py b/src/python/txtai/scoring/terms.py
index 87597375..a96dda6a 100644
--- a/src/python/txtai/scoring/terms.py
+++ b/src/python/txtai/scoring/terms.py
@@ -461,7 +461,7 @@ class Terms:
results = []
for term in terms:
- # Wilcard expressions
+ # Wildcard expressions
if Terms.ASTERISK in term:
# Require a prefix or suffix
if term.replace(Terms.ASTERISK, "").strip():