Compare commits
8 Commits
sidecar-v1
...
sidecar-v1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9fcc9a5bd | ||
|
|
ca5dc98d24 | ||
|
|
da49c04119 | ||
|
|
833ddb67de | ||
|
|
879a1f3fd6 | ||
|
|
6f9dc9a95e | ||
|
|
2a9a7e42a3 | ||
|
|
34b060a8a5 |
@@ -18,14 +18,34 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Check for python changes
|
||||
id: check_changes
|
||||
run: |
|
||||
# If triggered by workflow_dispatch, always build
|
||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||
echo "has_changes=true" >> $GITHUB_OUTPUT
|
||||
exit 0
|
||||
fi
|
||||
# Check if any python/ files changed in this commit
|
||||
CHANGED=$(git diff --name-only HEAD~1 HEAD -- python/ 2>/dev/null || echo "")
|
||||
if [ -n "$CHANGED" ]; then
|
||||
echo "has_changes=true" >> $GITHUB_OUTPUT
|
||||
echo "Python changes detected: $CHANGED"
|
||||
else
|
||||
echo "has_changes=false" >> $GITHUB_OUTPUT
|
||||
echo "No python/ changes detected, skipping sidecar build"
|
||||
fi
|
||||
|
||||
- name: Configure git
|
||||
if: steps.check_changes.outputs.has_changes == 'true'
|
||||
run: |
|
||||
git config user.name "Gitea Actions"
|
||||
git config user.email "actions@gitea.local"
|
||||
|
||||
- name: Bump sidecar patch version
|
||||
if: steps.check_changes.outputs.has_changes == 'true'
|
||||
id: bump
|
||||
run: |
|
||||
# Read current version from python/pyproject.toml
|
||||
@@ -46,23 +66,6 @@ jobs:
|
||||
echo "version=${NEW_VERSION}" >> $GITHUB_OUTPUT
|
||||
echo "tag=sidecar-v${NEW_VERSION}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Check for python changes
|
||||
id: check_changes
|
||||
run: |
|
||||
# If triggered by workflow_dispatch, always build
|
||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||
echo "has_changes=true" >> $GITHUB_OUTPUT
|
||||
exit 0
|
||||
fi
|
||||
# Check if any python/ files changed in this commit
|
||||
CHANGED=$(git diff --name-only HEAD~1 HEAD -- python/ || echo "")
|
||||
if [ -n "$CHANGED" ]; then
|
||||
echo "has_changes=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "has_changes=false" >> $GITHUB_OUTPUT
|
||||
echo "No python/ changes detected, skipping sidecar build"
|
||||
fi
|
||||
|
||||
- name: Commit and tag
|
||||
if: steps.check_changes.outputs.has_changes == 'true'
|
||||
env:
|
||||
|
||||
65
.gitea/workflows/cleanup-releases.yml
Normal file
65
.gitea/workflows/cleanup-releases.yml
Normal file
@@ -0,0 +1,65 @@
|
||||
name: Cleanup Old Releases
|
||||
|
||||
on:
|
||||
# Run after release and sidecar workflows complete
|
||||
schedule:
|
||||
- cron: '0 6 * * *' # Daily at 6am UTC
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
cleanup:
|
||||
name: Remove old releases
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
KEEP_COUNT: 5
|
||||
steps:
|
||||
- name: Cleanup old app releases
|
||||
env:
|
||||
BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }}
|
||||
run: |
|
||||
REPO_API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
|
||||
|
||||
# Get all releases, sorted newest first (API default)
|
||||
RELEASES=$(curl -s -H "Authorization: token ${BUILD_TOKEN}" \
|
||||
"${REPO_API}/releases?limit=50")
|
||||
|
||||
# Separate app releases (v*) and sidecar releases (sidecar-v*)
|
||||
APP_IDS=$(echo "$RELEASES" | jq -r '[.[] | select(.tag_name | startswith("v") and (startswith("sidecar") | not)) | .id] | .[]')
|
||||
SIDECAR_IDS=$(echo "$RELEASES" | jq -r '[.[] | select(.tag_name | startswith("sidecar-v")) | .id] | .[]')
|
||||
|
||||
# Delete app releases beyond KEEP_COUNT
|
||||
COUNT=0
|
||||
for ID in $APP_IDS; do
|
||||
COUNT=$((COUNT + 1))
|
||||
if [ $COUNT -le ${{ env.KEEP_COUNT }} ]; then
|
||||
continue
|
||||
fi
|
||||
TAG=$(echo "$RELEASES" | jq -r ".[] | select(.id == $ID) | .tag_name")
|
||||
echo "Deleting app release $ID ($TAG)..."
|
||||
curl -s -o /dev/null -w "HTTP %{http_code}\n" -X DELETE \
|
||||
-H "Authorization: token ${BUILD_TOKEN}" \
|
||||
"${REPO_API}/releases/$ID"
|
||||
# Also delete the tag
|
||||
curl -s -o /dev/null -X DELETE \
|
||||
-H "Authorization: token ${BUILD_TOKEN}" \
|
||||
"${REPO_API}/tags/$TAG"
|
||||
done
|
||||
|
||||
# Delete sidecar releases beyond KEEP_COUNT
|
||||
COUNT=0
|
||||
for ID in $SIDECAR_IDS; do
|
||||
COUNT=$((COUNT + 1))
|
||||
if [ $COUNT -le ${{ env.KEEP_COUNT }} ]; then
|
||||
continue
|
||||
fi
|
||||
TAG=$(echo "$RELEASES" | jq -r ".[] | select(.id == $ID) | .tag_name")
|
||||
echo "Deleting sidecar release $ID ($TAG)..."
|
||||
curl -s -o /dev/null -w "HTTP %{http_code}\n" -X DELETE \
|
||||
-H "Authorization: token ${BUILD_TOKEN}" \
|
||||
"${REPO_API}/releases/$ID"
|
||||
curl -s -o /dev/null -X DELETE \
|
||||
-H "Authorization: token ${BUILD_TOKEN}" \
|
||||
"${REPO_API}/tags/$TAG"
|
||||
done
|
||||
|
||||
echo "Cleanup complete. Kept latest ${{ env.KEEP_COUNT }} of each type."
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "voice-to-notes",
|
||||
"version": "0.2.25",
|
||||
"version": "0.2.28",
|
||||
"description": "Desktop app for transcribing audio/video with speaker identification",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "voice-to-notes"
|
||||
version = "1.0.9"
|
||||
version = "1.0.11"
|
||||
description = "Python sidecar for Voice to Notes — transcription, diarization, and AI services"
|
||||
requires-python = ">=3.11"
|
||||
license = "MIT"
|
||||
|
||||
@@ -254,15 +254,15 @@ def make_ai_chat_handler() -> HandlerFunc:
|
||||
)
|
||||
|
||||
if action == "configure":
|
||||
# Re-create a provider with custom settings
|
||||
# Re-create a provider with custom settings and set it active
|
||||
provider_name = payload.get("provider", "")
|
||||
config = payload.get("config", {})
|
||||
if provider_name == "local":
|
||||
from voice_to_notes.providers.local_provider import LocalProvider
|
||||
|
||||
service.register_provider("local", LocalProvider(
|
||||
base_url=config.get("base_url", "http://localhost:8080"),
|
||||
model=config.get("model", "local"),
|
||||
base_url=config.get("base_url", "http://localhost:11434/v1"),
|
||||
model=config.get("model", "llama3.2"),
|
||||
))
|
||||
elif provider_name == "openai":
|
||||
from voice_to_notes.providers.openai_provider import OpenAIProvider
|
||||
@@ -286,6 +286,10 @@ def make_ai_chat_handler() -> HandlerFunc:
|
||||
api_key=config.get("api_key"),
|
||||
api_base=config.get("api_base"),
|
||||
))
|
||||
# Set the configured provider as active
|
||||
print(f"[sidecar] Configured AI provider: {provider_name} with config: {config}", file=sys.stderr, flush=True)
|
||||
if provider_name in ("local", "openai", "anthropic", "litellm"):
|
||||
service.set_active(provider_name)
|
||||
return IPCMessage(
|
||||
id=msg.id,
|
||||
type="ai.configured",
|
||||
|
||||
@@ -56,7 +56,12 @@ def _patch_pyannote_audio() -> None:
|
||||
return _sf_load(file["audio"])
|
||||
|
||||
def _soundfile_crop(self, file: dict, segment, **kwargs) -> tuple:
|
||||
"""Replacement for Audio.crop — load full file then slice."""
|
||||
"""Replacement for Audio.crop — load full file then slice.
|
||||
|
||||
Pads short segments with zeros to match the expected duration,
|
||||
which pyannote requires for batched embedding extraction.
|
||||
"""
|
||||
duration = kwargs.get("duration", None)
|
||||
waveform, sample_rate = _sf_load(file["audio"])
|
||||
# Convert segment (seconds) to sample indices
|
||||
start_sample = int(segment.start * sample_rate)
|
||||
@@ -65,6 +70,14 @@ def _patch_pyannote_audio() -> None:
|
||||
start_sample = max(0, start_sample)
|
||||
end_sample = min(waveform.shape[-1], end_sample)
|
||||
cropped = waveform[:, start_sample:end_sample]
|
||||
# Pad to expected duration if needed (pyannote batches require uniform size)
|
||||
if duration is not None:
|
||||
expected_samples = int(duration * sample_rate)
|
||||
else:
|
||||
expected_samples = int((segment.end - segment.start) * sample_rate)
|
||||
if cropped.shape[-1] < expected_samples:
|
||||
pad = torch.zeros(cropped.shape[0], expected_samples - cropped.shape[-1])
|
||||
cropped = torch.cat([cropped, pad], dim=-1)
|
||||
return cropped, sample_rate
|
||||
|
||||
Audio.__call__ = _soundfile_call # type: ignore[assignment]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "voice-to-notes"
|
||||
version = "0.2.25"
|
||||
version = "0.2.28"
|
||||
description = "Voice to Notes — desktop transcription with speaker identification"
|
||||
authors = ["Voice to Notes Contributors"]
|
||||
license = "MIT"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "Voice to Notes",
|
||||
"version": "0.2.25",
|
||||
"version": "0.2.28",
|
||||
"identifier": "com.voicetonotes.app",
|
||||
"build": {
|
||||
"beforeDevCommand": "npm run dev",
|
||||
|
||||
Reference in New Issue
Block a user