summaryrefslogtreecommitdiff
path: root/candle-transformers
diff options
context:
space:
mode:
authorzachcp <zachcp@users.noreply.github.com>2024-11-18 22:07:07 -0500
committerGitHub <noreply@github.com>2024-11-19 04:07:07 +0100
commit3159f91b90a5bc68b275f8688472ba8917a834da (patch)
tree13a115866aab8f3126b7ce0aa93d4d9392ecaf74 /candle-transformers
parent1a0f9ccf16de9fc311b000a61e8e9e357a15855b (diff)
downloadcandle-3159f91b90a5bc68b275f8688472ba8917a834da.tar.gz
candle-3159f91b90a5bc68b275f8688472ba8917a834da.tar.bz2
candle-3159f91b90a5bc68b275f8688472ba8917a834da.zip
20241118 docs (#2629)
* module docs * varbuilder gguf docs * add a link to gguf files * small additonal mod doc titles * safetensor docs * more core docs * more module docs in canlde_core * 2 more link fixes
Diffstat (limited to 'candle-transformers')
-rw-r--r--candle-transformers/src/generation/mod.rs5
-rw-r--r--candle-transformers/src/object_detection.rs6
-rw-r--r--candle-transformers/src/quantized_nn.rs6
-rw-r--r--candle-transformers/src/quantized_var_builder.rs6
-rw-r--r--candle-transformers/src/utils.rs2
5 files changed, 25 insertions, 0 deletions
diff --git a/candle-transformers/src/generation/mod.rs b/candle-transformers/src/generation/mod.rs
index c250a186..d95a0595 100644
--- a/candle-transformers/src/generation/mod.rs
+++ b/candle-transformers/src/generation/mod.rs
@@ -1,3 +1,8 @@
+//! Logit Processing and Sampling
+//!
+//! Functionality for modeling sampling strategies and logits processing in text generation
+//! with support for temperature-based sampling, top-k filtering, nucleus sampling (top-p),
+//! and combinations thereof.
use candle::{DType, Error, Result, Tensor};
use rand::{distributions::Distribution, SeedableRng};
diff --git a/candle-transformers/src/object_detection.rs b/candle-transformers/src/object_detection.rs
index e922075f..d1b78cfa 100644
--- a/candle-transformers/src/object_detection.rs
+++ b/candle-transformers/src/object_detection.rs
@@ -1,3 +1,9 @@
+//! Bounding Boxes and Intersection
+//!
+//! This module provides functionality for handling bounding boxes and their manipulation,
+//! particularly in the context of object detection. It includes tools for calculating
+//! intersection over union (IoU) and non-maximum suppression (NMS).
+
/// A bounding box around an object.
#[derive(Debug, Clone)]
pub struct Bbox<D> {
diff --git a/candle-transformers/src/quantized_nn.rs b/candle-transformers/src/quantized_nn.rs
index 9298b80e..4a83253d 100644
--- a/candle-transformers/src/quantized_nn.rs
+++ b/candle-transformers/src/quantized_nn.rs
@@ -1,3 +1,9 @@
+//! Utilities for quanitized network layers
+//!
+//! This module contains various implementations of standard neural network layers, modules and
+//! utilities including embedding, linear layers, and various normalization techniques.
+//! Most implementations provide quantized weights support.
+
use crate::models::with_tracing::QMatMul;
use crate::quantized_var_builder::VarBuilder;
use candle::quantized::QTensor;
diff --git a/candle-transformers/src/quantized_var_builder.rs b/candle-transformers/src/quantized_var_builder.rs
index 875a2b45..2ac64aa5 100644
--- a/candle-transformers/src/quantized_var_builder.rs
+++ b/candle-transformers/src/quantized_var_builder.rs
@@ -1,3 +1,9 @@
+//! Varbuilder for Loading gguf files
+//!
+//! VarBuilder is a utility to store quantized tensors from a [GGUF model file](https://huggingface.co/docs/hub/gguf).
+//! These tensors can be loaded from disk using `from_gguf` or from an in-memory
+//! buffer using `from_gguf_buffer`.
+
use candle::quantized::QTensor;
use candle::{Device, Result, Shape};
use std::sync::Arc;
diff --git a/candle-transformers/src/utils.rs b/candle-transformers/src/utils.rs
index 17e83694..884d4f37 100644
--- a/candle-transformers/src/utils.rs
+++ b/candle-transformers/src/utils.rs
@@ -1,3 +1,5 @@
+//! Apply penalty and repeat_kv
+
use candle::{Result, Tensor};
pub fn apply_repeat_penalty(logits: &Tensor, penalty: f32, context: &[u32]) -> Result<Tensor> {