Skip to content

Commit af024e6

Browse files
committed
import fix
1 parent 30dd7b0 commit af024e6

14 files changed

Lines changed: 79 additions & 18 deletions

app_analysis.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ def cleaning_page():
3333
schema:
3434
type: string
3535
"""
36-
from flask import render_template
3736
return render_template('cleaning.html', title = 'AudioMuse-AI - Database Cleaning', active='cleaning')
3837

3938
@analysis_bp.route('/api/analysis/start', methods=['POST'])

app_clustering.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
AI_MODEL_PROVIDER, OLLAMA_SERVER_URL, OLLAMA_MODEL_NAME, OPENAI_SERVER_URL,
1919
OPENAI_MODEL_NAME, OPENAI_API_KEY, GEMINI_API_KEY, GEMINI_MODEL_NAME,
2020
TOP_N_PLAYLISTS, MISTRAL_API_KEY, MISTRAL_MODEL_NAME,
21-
TASK_STATUS_PENDING, TASK_STATUS_FAILURE, TASK_STATUS_SUCCESS,
22-
TASK_STATUS_STARTED, TASK_STATUS_PROGRESS, TASK_STATUS_REVOKED,
21+
TASK_STATUS_PENDING, TASK_STATUS_FAILURE,
2322
)
2423

2524
# RQ import

lyrics/lyrics_transcriber.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,6 @@ def _fetch_from_configured_api(
379379
url,
380380
headers={'Accept': 'application/json'},
381381
)
382-
import socket
383382
ctx = None
384383
try:
385384
import ssl

rq_worker.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
try:
3131
from app_helper import redis_conn
3232
from app_logging import configure_logging
33-
import config
3433
from config import APP_VERSION, TEMP_DIR
3534
except ImportError as e:
3635
print(f"Error importing worker dependencies: {e}")

tasks/cleaning.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import time
44
import logging
55
import uuid
6-
import traceback
76
from collections import defaultdict
87

98
# RQ import

tasks/clustering.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
ITERATIONS_PER_BATCH_JOB, MAX_CONCURRENT_BATCH_JOBS,
2828
MIN_PLAYLIST_SIZE_FOR_TOP_N, CLUSTERING_BATCH_TIMEOUT_MINUTES,
2929
CLUSTERING_MAX_FAILED_BATCHES, CLUSTERING_CLEANING,
30-
TASK_STATUS_PENDING, TASK_STATUS_STARTED, TASK_STATUS_PROGRESS,
30+
TASK_STATUS_STARTED, TASK_STATUS_PROGRESS,
3131
TASK_STATUS_SUCCESS, TASK_STATUS_FAILURE, TASK_STATUS_REVOKED,
3232
)
3333

tasks/voyager_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ def find_nearest_neighbors_by_vector(query_vector: np.ndarray, n: int = 100, eli
10371037
if voyager_index is None or id_map is None:
10381038
raise RuntimeError("Voyager index is not loaded in memory.")
10391039

1040-
from app_helper import get_db, get_score_data_by_ids
1040+
from app_helper import get_db
10411041
db_conn = get_db()
10421042

10431043
# If caller didn't supply eliminate_duplicates explicitly (None), use configured default

test/integration/test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,6 @@ def test_map_visualization():
255255
elapsed = time.time() - start_time
256256
print(f"[TIMING] Map Visualization test completed in {elapsed:.2f} seconds")
257257

258-
import pytest
259-
260258
#pytest -v -s test.py -k test_annoy_similarity_and_playlist
261259
def test_annoy_similarity_and_playlist():
262260
start_time = time.time()

test/integration/test_analysis_integration.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import sys
1616
import types
1717
from pathlib import Path
18-
import importlib
1918
import json
2019
import pytest
2120

test/unit/test_ai.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ def _ensure_google_genai_stub():
8181
google_mod.__path__ = []
8282
sys.modules['google'] = google_mod
8383
from unittest.mock import MagicMock as _MM
84-
from unittest.mock import MagicMock as _MM
8584
genai_mod = types.ModuleType('google.genai')
8685
genai_mod.Client = _MM
8786
genai_types = types.ModuleType('google.genai.types')
@@ -123,7 +122,7 @@ def _ensure_mistralai_stub():
123122
_load_submodule(_name, _relpath)
124123

125124

126-
from unittest.mock import Mock, patch, call
125+
from unittest.mock import Mock, patch
127126
import requests
128127
import json
129128
from tasks.ai.api import clean_playlist_name, get_ai_playlist_name

0 commit comments

Comments
 (0)