Skip to content

Commit 5512fa6

Browse files
author
samcraftt
committed
lint
1 parent 52b1262 commit 5512fa6

6 files changed

Lines changed: 25 additions & 4 deletions

File tree

server_api/chatbot/file_summaries/App.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ App
1515
## Components
1616

1717
### `CacheBootstrapper`
18+
1819
- Runs `resetFileState()` from `AppContext` on mount
1920
- Clears local cache (files, fileList, etc.) before rendering children
2021
- Renders nothing until cache is cleared; then renders main content
2122

2223
### `MainContent`
24+
2325
- Renders `Views` component (main application layout with tabs)
2426

2527
## Contexts

server_api/chatbot/file_summaries/api.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,41 @@ Central API client for the PyTC Client frontend. Exposes functions for all backe
99
## Exports
1010

1111
### `apiClient`
12+
1213
Axios instance with base URL, `withCredentials: true`. Used for general requests (e.g. `/files`, `/files/upload`).
1314

1415
### Visualization
16+
1517
- **`getNeuroglancerViewer(image, label, scales)`** — Launches Neuroglancer viewer. Accepts file objects or path strings. Uses FormData for browser uploads.
1618

1719
### File Checks
20+
1821
- **`checkFile(file)`** — POST to `/check_files` to detect if file is likely a label (heuristic).
1922

2023
### Generic
24+
2125
- **`makeApiRequest(url, method, data)`** — HTTP request helper with JSON Content-Type.
2226

2327
### Model Training
28+
2429
- **`startModelTraining(trainingConfig, logPath, outputPath)`** — Injects OUTPUT_PATH into YAML config and POSTs to `/start_model_training`
2530
- **`stopModelTraining()`**
2631
- **`getTrainingStatus()`**
2732
- **`getTensorboardURL()`**
2833

2934
### Model Inference
35+
3036
- **`startModelInference(inferenceConfig, outputPath, checkpointPath)`** — Injects OUTPUT_PATH into YAML, sets NUM_GPUS=1, POSTs to `/start_model_inference`
3137
- **`stopModelInference()`**
3238
- **`getInferenceStatus()`**
3339

3440
### Chatbot
41+
3542
- **`queryChatBot(query)`** — POST to `/chat/query`
3643
- **`clearChat()`** — POST to `/chat/clear`
3744

3845
### Config Presets
46+
3947
- **`getConfigPresets()`** — GET `/pytc/configs`
4048
- **`getConfigPresetContent(path)`** — GET `/pytc/config`
4149
- **`getModelArchitectures()`** — GET `/pytc/architectures`

server_api/chatbot/file_summaries/components/YamlFileEditor.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ Advanced YAML configuration editor with structured controls (switches, selects,
99
## Sections (CONTROL_SECTIONS)
1010

1111
### Training
12+
1213
- Common training knobs: Optimizer, LR scheduler, learning rate, batch size, iterations, save/validation intervals
1314
- System: Distributed, Parallel mode, Debug mode
1415
- Model: Block type, Backbone, Normalization, Activation, Pooling, Mixed precision, Aux output
1516
- Dataset: 2D dataset, Load 2D slices, Isotropic, Drop channels, Reduce labels, Ensure min size, Pad mode
1617
- Solver (advanced): Weight decay, Momentum, Clip gradients
1718

1819
### Inference
20+
1921
- Common: Batch size, Augmentations, Blending, Eval mode
2022
- Advanced: Run singly, Unpad output, Augment mode, Test count
2123

server_api/chatbot/file_summaries/contexts/YamlContext.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ Context for YAML-related UI state (GPUs, batch size, etc.). Used by `YamlFileUpl
55
## State
66

77
### Training
8+
89
- `numGPUs`, `numCPUs`
910
- `solverSamplesPerBatch`, `learningRate`
1011

1112
### Inference
13+
1214
- `inferenceSamplesPerBatch`, `augNum`
1315

1416
## YamlContextWrapper

server_api/chatbot/file_summaries/main.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ FastAPI server that powers the PyTC Client application. Provides API endpoints f
1818
## Key Endpoints
1919

2020
### Health & Config
21+
2122
- `GET /health` — Server status check
2223
- `GET /pytc/configs` — List PyTorch Connectomics config presets (YAML)
2324
- `GET /pytc/config?path=...` — Get config file content
2425
- `GET /pytc/architectures` — List model architectures from build.py
2526

2627
### Model Training & Inference
28+
2729
- `POST /start_model_training` — Proxy to PyTC server (localhost:4243)
2830
- `POST /stop_model_training` — Stop training
2931
- `GET /training_status` — Training status polling
@@ -32,12 +34,15 @@ FastAPI server that powers the PyTC Client application. Provides API endpoints f
3234
- `GET /get_tensorboard_url` — Returns TensorBoard URL (default: localhost:6006)
3335

3436
### Visualization
37+
3538
- `POST /neuroglancer` — Create Neuroglancer viewer for image/label volumes. Accepts JSON or multipart/form-data with image, label, scales.
3639

3740
### Data & Files
41+
3842
- `POST /check_files` — Heuristic check if file is a label (integer type, low unique values, or binary)
3943

4044
### Chatbot (RAG)
45+
4146
- `POST /chat/query` — Chat query (requires chatbot configured)
4247
- `POST /chat/clear` — Clear chat history
4348
- `GET /chat/status` — Check if chatbot is configured

server_api/chatbot/update_faiss.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
'''
1+
"""
22
How to update faiss_index:
33
1. Delete the existing server_api/chatbot/file_summaries directory
44
2. Paste the following prompt into Cursor (or any AI IDE, in agent mode):
55
6-
Create markdown files summarizing server_api/main.py and each file in client/src/*/** (including files in nested directories),
6+
Create markdown files summarizing server_api/main.py and each file in client/src/*/** (including files in nested directories),
77
but don't create markdown files for index.js, utils.js, or any CSS files.
88
These markdown files will serve as the knowledge base for a RAG chatbot that helps end users navigate the frontend client.
99
Put these markdown files in a new server_api/chatbot/file_summaries directory.
1010
1111
3. Run this script:
1212
python server_api/chatbot/update_faiss.py
13-
'''
13+
"""
1414

1515
from pathlib import Path
1616
from langchain_core.documents import Document
@@ -30,7 +30,9 @@
3030
metadata={"source": str(relative_path)},
3131
)
3232
)
33-
embeddings = OllamaEmbeddings(model="mistral:latest", base_url="http://cscigpu08.bc.edu:11434")
33+
embeddings = OllamaEmbeddings(
34+
model="mistral:latest", base_url="http://cscigpu08.bc.edu:11434"
35+
)
3436
vectorstore = FAISS.from_documents(documents, embeddings)
3537
faiss_directory.mkdir(parents=True, exist_ok=True)
3638
vectorstore.save_local(str(faiss_directory))

0 commit comments

Comments
 (0)