You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: server_api/chatbot/chatbot.py
+75-70Lines changed: 75 additions & 70 deletions
Original file line number
Diff line number
Diff line change
@@ -23,69 +23,62 @@
23
23
24
24
TRAINING_AGENT_PROMPT="""You are a **Training Agent** for PyTorch Connectomics.
25
25
26
-
You help users set up and configure training jobs for biomedical image segmentation.
27
-
28
-
CRITICAL RULES:
29
-
1. **Only report values that your tools return.** Do NOT invent hyperparameter values, config names, or file paths.
30
-
2. **Always use tools before answering.** Call list_training_configs or read_config first — never guess.
31
-
3. **Be concise.** Report the facts, generate the command, and stop.
26
+
RULES:
27
+
1. Only report values that your tools return. Do NOT invent config names, paths, or settings.
28
+
2. Never tell the user to write a YAML from scratch. Always start from an existing config.
29
+
3. If the task is unsupported, say so. PyTC only does segmentation.
30
+
4. Be concise. State the facts, generate the command, stop.
32
31
33
-
Tools:
34
-
- list_training_configs: List available config files with descriptions
35
-
- read_config: Read a config file to see its hyperparameters
32
+
WORKFLOW: The available configs are provided in your task message. Pick the best match, then:
33
+
1. Call read_config on the chosen config path to see its YAML overrides.
34
+
2. For common parameters (learning rate, batch size, iterations, optimizer, checkpoint interval), ALWAYS use the keys listed below. DO NOT search for these.
35
+
3. For specialized parameters (augmentation settings, loss functions, architecture details), call search_documentation.
36
+
4. Build the command with overrides using the SECTION.KEY=value format.
36
37
37
-
Workflow:
38
-
1. Use list_training_configs to find configs matching user's task
39
-
2. Use read_config to examine the config's current settings
40
-
3. Compare user requirements with config defaults
41
-
4. Generate the training command with appropriate overrides
38
+
IMPORTANT: YAML configs only show overrides — many valid keys exist in the defaults but are not shown in read_config output.
- **General PyTC questions** (what architectures are supported, what augmentations exist, what loss functions are available, etc.) → search_documentation
97
91
- **Generate a specific training/inference command** → delegate_to_training_agent or delegate_to_inference_agent
98
92
- **General/greeting/off-topic** → answer directly, no tool needed
99
93
@@ -103,18 +97,19 @@
103
97
3. **For application questions, ground answers in retrieved documentation.** Call search_documentation and base your answer on the returned text. Do NOT invent features, shortcuts, buttons, or workflows.
104
98
4. **Do not fabricate specifics.** Never make up keyboard shortcuts, button labels, or step-by-step instructions unless they come from retrieved docs or a sub-agent response.
105
99
4a. **NEVER use command-line instructions for UI questions.** The PyTC Client is a desktop GUI application. If the user asks how to do something, explain the UI workflow (buttons, tabs, forms) from the documentation. Do NOT provide Python scripts, bash commands, or CLI examples unless the sub-agent explicitly generates them.
100
+
4b. **NEVER fabricate file paths or scripts.** Do NOT invent scripts like `scripts/evaluate.py`, `scripts/resume_training.py`, or any other files that don't exist. If evaluation requires Python code, show inline code using `connectomics.utils.evaluate`, not fake script paths.
106
101
5. **Answer every part of the user's question.** If they ask about two things, address both.
107
102
6. **Use retrieved content even if wording differs.** If the documentation describes relevant features or workflows, use that information to answer the question. Don't claim something isn't documented just because it uses different terminology than the user's question.
108
-
7. **HARD LIMIT: You may call search_documentation EXACTLY 2 times per user question.** After the second call, you MUST answer with the information already retrieved. Do NOT attempt a third search. If the tool returns "Search limit reached", immediately stop and answer based on what you already have.
103
+
7. **HARD LIMIT: You may call search_documentation at most 3 times yourself.** Sub-agents also have access to search_documentation. If the tool returns "Search limit reached", immediately stop and answer based on what you already have.
109
104
110
105
Sub-agents:
111
106
- **Training Agent**: Config selection, training job setup, hyperparameter overrides
- search_documentation: Search PyTC docs for UI guides and feature explanations. Use ONLY for questions about the application interface, pages, buttons, or workflows.
116
-
- delegate_to_training_agent: Send training-related tasks to training agent
117
-
- delegate_to_inference_agent: Send inference-related tasks to inference agent"""
110
+
- search_documentation: Search PyTC docs for UI guides, feature explanations, training/inference config references, model architectures, augmentation options, and bundled configs.
111
+
- delegate_to_training_agent: Send training-related tasks to training agent (config selection, command generation, hyperparameter tuning)
This document describes all data augmentation options available in PyTorch Connectomics. These augmentations are specifically designed for electron microscopy (EM) and biomedical volumetric data.
4
+
5
+
All augmentations are controlled under the `AUGMENTOR` section of the YAML config. Set `AUGMENTOR.ENABLED: False` to disable all augmentation.
6
+
7
+
## Available Augmentations
8
+
9
+
### Rotation (`AUGMENTOR.ROTATE`)
10
+
Applies random 90-degree rotations.
11
+
12
+
| Key | Default | Description |
13
+
|-----|---------|-------------|
14
+
|`ENABLED`|`True`| Enable rotation |
15
+
|`ROT90`|`True`| Restrict to 90° increments |
16
+
|`P`|`1.0`| Probability of applying |
17
+
18
+
### Rescale (`AUGMENTOR.RESCALE`)
19
+
Randomly rescales the volume.
20
+
21
+
| Key | Default | Description |
22
+
|-----|---------|-------------|
23
+
|`ENABLED`|`True`| Enable rescaling |
24
+
|`FIX_ASPECT`|`False`| Keep aspect ratio fixed |
25
+
|`P`|`0.5`| Probability |
26
+
27
+
### Flip (`AUGMENTOR.FLIP`)
28
+
Randomly flips along axes. For isotropic data, enable z-axis flips.
29
+
30
+
| Key | Default | Description |
31
+
|-----|---------|-------------|
32
+
|`ENABLED`|`True`| Enable flipping |
33
+
|`DO_ZTRANS`|`0`| Set to `1` to enable x-z and y-z flips (for isotropic cubic data) |
34
+
|`P`|`1.0`| Probability |
35
+
36
+
### Elastic Deformation (`AUGMENTOR.ELASTIC`)
37
+
Applies smooth elastic deformation to simulate tissue warping.
38
+
39
+
| Key | Default | Description |
40
+
|-----|---------|-------------|
41
+
|`ENABLED`|`True`| Enable elastic deformation |
42
+
|`ALPHA`|`16.0`| Maximum pixel displacement |
43
+
|`SIGMA`|`4.0`| Gaussian filter standard deviation |
- Consider disabling `CUTNOISE` to avoid corrupting sparse regions
150
+
151
+
## Per-Augmentation Skipping
152
+
153
+
Each augmentation has a `SKIP` parameter (list of sample keys to skip). This allows skipping certain augmentations for specific data channels. Default is an empty list (no skipping).
0 commit comments