Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Semantic Router
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
aurelio-labs
Semantic Router
Commits
29165f91
Commit
29165f91
authored
4 months ago
by
James Briggs
Browse files
Options
Downloads
Patches
Plain Diff
feat: update the sync doc
parent
956d2cd8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/source/route_layer/sync.rst
+56
-5
56 additions, 5 deletions
docs/source/route_layer/sync.rst
with
56 additions
and
5 deletions
docs/source/route_layer/sync.rst
+
56
−
5
View file @
29165f91
Synchronizing the Route Layer with Indexes
Synchronizing the Route Layer with Indexes
==========================================
=
==========================================
The `RouteLayer` class is the main class in the semantic router package. It
The `RouteLayer` class is the main class in the semantic router package. It
contains the routes and allows us to interact with the underlying index. Both
contains the routes and allows us to interact with the underlying index. Both
...
@@ -147,11 +147,26 @@ objects match, we know that the local and remote instances are synchronized and
...
@@ -147,11 +147,26 @@ objects match, we know that the local and remote instances are synchronized and
we can return `True`. If the two objects do not match, we must investigate and
we can return `True`. If the two objects do not match, we must investigate and
decide how to synchronize the two instances.
decide how to synchronize the two instances.
Resolving Synchronization Differences
To quickly sync the local and remote instances we can use the `RouteLayer.sync`
-------------------------------------
method. This method is equivalent to the `auto_sync` strategy specified when
initializing the `RouteLayer` object. So, if we assume our local `RouteLayer`
object contains the ground truth routes, we would use the `local` strategy to
copy our local routes to the remote instance.
The first step in resolving synchronization differences is to understand the
.. code-block:: python
nature of the differences. We can get a readable diff using the
rl.sync(sync_mode="local")
After running the above code, we can check whether the local and remote
instances are synchronized by rerunning `rl.is_synced()`, which should now
return `True`.
Investigating Synchronization Differences
-----------------------------------------
We may often need to further investigate and understand *why* our local and
remote instances have become desynchronized. The first step in further investigation and resolution of synchronization
differences is to see the differences. We can get a readable diff using the
`RouteLayer.get_utterance_diff` method.
`RouteLayer.get_utterance_diff` method.
.. code-block:: python
.. code-block:: python
...
@@ -218,3 +233,39 @@ each diff tag like so:
...
@@ -218,3 +233,39 @@ each diff tag like so:
# all utterances that exist in both local and remote
# all utterances that exist in both local and remote
diff.get_utterances(diff_tag=' ')
diff.get_utterances(diff_tag=' ')
These can be investigated if needed. Once we're happy with our understanding
of the issues we can resolve them by executing a synchronization by running
the `RouteLayer._execute_sync_strategy` method:
.. code-block:: python
rl._execute_sync_strategy(sync_mode="local")
Once complete, we can confirm that our local and remote instances are
synchronized by running `rl.is_synced()`:
.. code-block:: python
rl.is_synced()
If the above returns `True` we are now synchronized!
.=
:%%*
-%%%%#
=%%%%%%#.
+%%%%%%%+
*%%%%%%%=
.#%%%%%%%-
.#%%%%%%%: -%:
:%%%%%%%#. =%%%=
-%%%%%%%# *%%%%%+
=%%%%%%%* -%%%%%%%*
.-------: -%%%%%%%#
:*****************+ :%%%%%%%#.
-%%%%%%%%%%%%%%%%%%%* .#%%%%%%%:
=%%%%%%%%%%%%%%%%%%%%%#..#%%%%%%%-
+%%%%%%%%%%%%%%%%%%%%%%%#. *%%%%%%%=
+%%%%%%%+
=#######+
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment