Compare commits
2 Commits
7ed475736e
...
aefdcb38de
| Author | SHA1 | Date | |
|---|---|---|---|
| aefdcb38de | |||
| 94da6f618d |
158
.gitignore
vendored
Normal file
158
.gitignore
vendored
Normal 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/
|
||||||
@@ -3,10 +3,8 @@
|
|||||||
//! This module defines all HTTP endpoints for the AI generation system,
|
//! This module defines all HTTP endpoints for the AI generation system,
|
||||||
//! including model management, inference requests, and task status monitoring.
|
//! 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 serde::{Deserialize, Serialize};
|
||||||
use std::sync::Arc;
|
|
||||||
use tokio::sync::Mutex;
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
AppState,
|
AppState,
|
||||||
@@ -158,11 +156,11 @@ pub async fn get_all_tasks(state: web::Data<AppState>) -> Result<HttpResponse> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Configuration for API routes
|
/// 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))
|
cfg.route("/health", web::get().to(health_check))
|
||||||
.route("/system-info", web::get().to(get_system_info))
|
.route("/system-info", web::get().to(get_system_info))
|
||||||
.route("/models", web::get().to(get_models))
|
.route("/models", web::get().to(get_models))
|
||||||
.route("/infer", web::post().to(start_inference))
|
.route("/infer", web::post().to(start_inference))
|
||||||
.route("/tasks/{task_id}", web::get().to(get_task_status))
|
.route("/tasks/{task_id}", web::get().to(get_task_status))
|
||||||
.route("/tasks", web::get().to(get_all_tasks));
|
.route("/tasks", web::get().to(get_all_tasks));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
//! This server provides a REST API and WebSocket endpoints for
|
//! This server provides a REST API and WebSocket endpoints for
|
||||||
//! managing image/video generation workflows on AMD GPUs.
|
//! 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 serde::{Deserialize, Serialize};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use tokio::sync::Mutex;
|
use tokio::sync::Mutex;
|
||||||
@@ -12,7 +12,6 @@ pub mod api;
|
|||||||
pub mod models;
|
pub mod models;
|
||||||
pub mod queue_service;
|
pub mod queue_service;
|
||||||
pub mod rocminfo;
|
pub mod rocminfo;
|
||||||
pub mod session_manager;
|
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct AppState {
|
pub struct AppState {
|
||||||
|
|||||||
@@ -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 serde::{Deserialize, Serialize};
|
||||||
use std::collections::HashMap;
|
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)]
|
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||||
pub struct ModelInfo {
|
pub struct ModelInfo {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
|
|||||||
@@ -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 serde::{Deserialize, Serialize};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use tokio::sync::{Mutex, Notify};
|
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)]
|
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||||
pub struct Task {
|
pub struct Task {
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|||||||
Reference in New Issue
Block a user