Compare commits

...

2 Commits

Author SHA1 Message Date
aefdcb38de refactor(api): simplify actix_web imports and remove unused modules
- Removed unused imports (Scope, Arc, Mutex) from api/mod.rs
- Updated config function signature to use ServiceConfig instead of Scope
- Removed unused session_manager module from main.rs
- Cleaned up documentation comments in models and queue_service modules
- Simplified import statements across backend modules for better readability

This refactoring removes unnecessary dependencies and cleans up the codebase by eliminating unused imports and redundant documentation while maintaining all functionality.
2026-03-03 00:08:58 +01:00
94da6f618d added .gitignore 2026-03-02 23:30:14 +01:00
5 changed files with 170 additions and 21 deletions

158
.gitignore vendored Normal file
View File

@@ -0,0 +1,158 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# code distribution
pyinstaller-build/
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.log
.mypy_cache/
.pytest_cache/
.pycov/
# Django stuff:
*.log
local_settings.py
db.sqlite3
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# pipenv
Pipfile.lock
# PEP 582
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath notebooks
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyproject/
.spyproject/
# Rope config
.rope/
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre
.pyre/
# IDE
.vscode/
.idea/
*.swp
*.swo
# OS generated files
.DS_Store
Thumbs.db
# Rust build artifacts
target/
Cargo.lock
Cargo.toml~
# Node.js dependencies
node_modules/
npm-debug.log
yarn-debug.log
yarn-error.log
# Build directories and output
build/
dist/
out/
# Environment variables
.env.local
.env.*.local
# Editor files
*.backup
*~
# Temporary files
*.tmp
*.temp
# Logs
*.log
logs/

View File

@@ -3,10 +3,8 @@
//! This module defines all HTTP endpoints for the AI generation system,
//! including model management, inference requests, and task status monitoring.
use actix_web::{web, HttpResponse, Result, Scope};
use actix_web::{web, HttpResponse, Result};
use serde::{Deserialize, Serialize};
use std::sync::Arc;
use tokio::sync::Mutex;
use crate::{
AppState,
@@ -158,11 +156,11 @@ pub async fn get_all_tasks(state: web::Data<AppState>) -> Result<HttpResponse> {
}
/// Configuration for API routes
pub fn config(cfg: &mut Scope) {
pub fn config(cfg: &mut actix_web::web::ServiceConfig) {
cfg.route("/health", web::get().to(health_check))
.route("/system-info", web::get().to(get_system_info))
.route("/models", web::get().to(get_models))
.route("/infer", web::post().to(start_inference))
.route("/tasks/{task_id}", web::get().to(get_task_status))
.route("/tasks", web::get().to(get_all_tasks));
}
}

View File

@@ -3,7 +3,7 @@
//! This server provides a REST API and WebSocket endpoints for
//! managing image/video generation workflows on AMD GPUs.
use actix_web::{web, App, HttpServer, Result, middleware::Logger};
use actix_web::{web, App, HttpServer, middleware::Logger};
use serde::{Deserialize, Serialize};
use std::sync::Arc;
use tokio::sync::Mutex;
@@ -12,7 +12,6 @@ pub mod api;
pub mod models;
pub mod queue_service;
pub mod rocminfo;
pub mod session_manager;
#[derive(Debug, Clone)]
pub struct AppState {

View File

@@ -1,13 +1,10 @@
//! Model management for AI inference workflows
//!
//! This module handles loading, caching, and managing different types of
//! machine learning models needed for image/video generation.
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::sync::Arc;
use tokio::sync::Mutex;
/// Model management for AI inference workflows
///
/// This module handles loading, caching, and managing different types of
/// machine learning models needed for image/video generation.
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct ModelInfo {
pub name: String,

View File

@@ -1,15 +1,12 @@
//! Task queue service for managing concurrent AI inference tasks
//!
//! This module provides a thread-safe task queue system using Tokio
//! and Rayon for parallel processing on AMD GPUs.
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::sync::Arc;
use tokio::sync::{Mutex, Notify};
use uuid::Uuid;
/// Task queue service for managing concurrent AI inference tasks
///
/// This module provides a thread-safe task queue system using Tokio
/// and Rayon for parallel processing on AMD GPUs.
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct Task {
pub id: String,