From 81f46dc5833fbf3a63e52cdd495b8bdba8f11c26 Mon Sep 17 00:00:00 2001 From: boxbeam Date: Sat, 6 Jan 2024 19:36:22 -0500 Subject: [PATCH] docs: Crate doc comments (#1168) * doc: Add basic doc comments describing most of the tabby crates * Apply suggestions from code review Co-authored-by: Meng Zhang --------- Co-authored-by: Meng Zhang --- crates/llama-cpp-bindings/src/lib.rs | 1 + crates/tabby-common/src/lib.rs | 2 ++ crates/tabby-download/src/lib.rs | 1 + crates/tabby-inference/src/lib.rs | 1 + crates/tabby-scheduler/src/lib.rs | 2 ++ crates/tabby/src/main.rs | 1 + ee/tabby-webserver/src/lib.rs | 2 ++ 7 files changed, 10 insertions(+) diff --git a/crates/llama-cpp-bindings/src/lib.rs b/crates/llama-cpp-bindings/src/lib.rs index 0dbdaf9cbea2..6a3205622cef 100644 --- a/crates/llama-cpp-bindings/src/lib.rs +++ b/crates/llama-cpp-bindings/src/lib.rs @@ -1,3 +1,4 @@ +//! Bindings to raw C++ LLaMA implementation. implements the TextGeneration trait and being used in tabby to generate text / code. mod llama; mod utils; diff --git a/crates/tabby-common/src/lib.rs b/crates/tabby-common/src/lib.rs index 8966adf89590..76bb46b0bfd5 100644 --- a/crates/tabby-common/src/lib.rs +++ b/crates/tabby-common/src/lib.rs @@ -1,3 +1,5 @@ +//! Common tabby types and utilities. +//! Defines common types and utilities used across multiple tabby subprojects, especially serialization and deserialization targets. pub mod api; pub mod config; pub mod index; diff --git a/crates/tabby-download/src/lib.rs b/crates/tabby-download/src/lib.rs index 5ec3a049ca3c..da69efbfa408 100644 --- a/crates/tabby-download/src/lib.rs +++ b/crates/tabby-download/src/lib.rs @@ -1,3 +1,4 @@ +//! Responsible for downloading ML models for use with tabby. use std::{fs, path::Path}; use aim_downloader::{bar::WrappedBar, https}; diff --git a/crates/tabby-inference/src/lib.rs b/crates/tabby-inference/src/lib.rs index e4052d0cf919..82b98e2b6c8f 100644 --- a/crates/tabby-inference/src/lib.rs +++ b/crates/tabby-inference/src/lib.rs @@ -1,3 +1,4 @@ +//! Lays out the abstract definition of a text generation model, and utilities for encodings. pub mod decoding; use async_trait::async_trait; diff --git a/crates/tabby-scheduler/src/lib.rs b/crates/tabby-scheduler/src/lib.rs index f59080021da7..c66b6eb04325 100644 --- a/crates/tabby-scheduler/src/lib.rs +++ b/crates/tabby-scheduler/src/lib.rs @@ -1,3 +1,5 @@ +//! Responsible for scheduling all of the background jobs for tabby. +//! Includes syncing respositories and updating indices. mod dataset; mod index; mod repository; diff --git a/crates/tabby/src/main.rs b/crates/tabby/src/main.rs index 233d806982e2..8ad8eb88f2dc 100644 --- a/crates/tabby/src/main.rs +++ b/crates/tabby/src/main.rs @@ -1,3 +1,4 @@ +//! Core tabby functionality. Defines primary API and CLI behavior. mod routes; mod services; diff --git a/ee/tabby-webserver/src/lib.rs b/ee/tabby-webserver/src/lib.rs index 1812d22ac100..b7f09a70ffd8 100644 --- a/ee/tabby-webserver/src/lib.rs +++ b/ee/tabby-webserver/src/lib.rs @@ -1,3 +1,5 @@ +//! Defines behavior for the tabby webserver which allows users to interact with enterprise features. +//! Using the web interface (e.g chat playground) requires using this module with the `--webserver` flag on the command line. mod handler; mod hub; mod oauth;