feat: Introduce llm_weights folder and setup.ps1 script for model installation
This commit is contained in:
parent
2a6c2300f6
commit
3039970993
|
|
@ -11,4 +11,5 @@ data/samples/
|
|||
.pytest_cache/
|
||||
*.pyc
|
||||
*.whl
|
||||
*.log
|
||||
*.log
|
||||
/llm_weights/
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
```bash
|
||||
uv sync
|
||||
```
|
||||
- **[주의] 대용량 언어모델 수동 배치**: `Qwen3.5-0.8B-Q4_K_M.gguf` (또는 지정된 모델 버전)와 같은 대형 `.gguf` 파일들은 `.gitignore` 처리되어 Git에서 제외되므로 개별적으로 다운로드 받아 프로젝트 **루트 폴더**에 배치해야 합니다.
|
||||
- **[주의] 대용량 언어모델 수동 배치**: `Qwen3.5-0.8B-Q4_K_M.gguf` (또는 지정된 모델 버전)와 같은 대형 `.gguf` 파일들은 `.gitignore` 처리되어 Git에서 제외되므로 개별적으로 다운로드 받아 프로젝트 내 **`llm_weights/`** 폴더 안에 배치해야 합니다. (동봉된 `setup.ps1` 스크립트를 관리자 권한으로 실행하면 모델 다운로드 및 폴더 생성까지 자동으로 처리됩니다).
|
||||
- 최초 기동 시 오디오 저장 폴더(`data/audio/`, `data/samples/`) 및 로컬 DB 파일(`whisper.db`)은 시스템 내에 자동으로 초기화됩니다.
|
||||
|
||||
2. **서버 실행**:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,80 @@
|
|||
<#
|
||||
.SYNOPSIS
|
||||
HUTAMS 프로젝트 최초 설정 스크립트.
|
||||
|
||||
.DESCRIPTION
|
||||
1. uv 동기화(의존성 라이브러리 설치)
|
||||
2. llm_weights 폴더 생성
|
||||
3. 대용량 언어모델(.gguf) 다운로드 (존재하지 않을 경우)
|
||||
#>
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
Write-Host "=========================================" -ForegroundColor Cyan
|
||||
Write-Host " HUTAMS STT 프로젝트 초기화 스크립트 " -ForegroundColor Cyan
|
||||
Write-Host "=========================================" -ForegroundColor Cyan
|
||||
|
||||
# 1. uv 패키지 설치
|
||||
Write-Host "`n[1] 패키지 매니저(uv) 동기화 중..." -ForegroundColor Yellow
|
||||
try {
|
||||
uv sync
|
||||
Write-Host "패키지 설치 완료!" -ForegroundColor Green
|
||||
}
|
||||
catch {
|
||||
Write-Host "uv 실행 실패. uv가 설치되어 있는지 확인해주세요." -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
# 2. 로컬 모델 폴더 확인 및 생성
|
||||
$ModelDir = "llm_weights"
|
||||
if (-Not (Test-Path -Path $ModelDir)) {
|
||||
Write-Host "`n[2] 모델 폴더($ModelDir) 생성 중..." -ForegroundColor Yellow
|
||||
New-Item -ItemType Directory -Force -Path $ModelDir | Out-Null
|
||||
Write-Host "폴더 생성 완료!" -ForegroundColor Green
|
||||
}
|
||||
else {
|
||||
Write-Host "`n[2] 모델 폴더($ModelDir)가 이미 존재합니다." -ForegroundColor Green
|
||||
}
|
||||
|
||||
# 3. 모델 다운로드
|
||||
$Model1Name = "Qwen3.5-0.8B-Q4_K_M.gguf"
|
||||
$ModelPath = Join-Path -Path $ModelDir -ChildPath $ModelName
|
||||
$DownloadUrl1 = "https://huggingface.co/unsloth/Qwen3.5-0.8B-GGUF/resolve/main/Qwen3.5-0.8B-Q4_K_M.gguf?download=true"
|
||||
|
||||
$Model2Name = "Qwen3.5-2B-Q4_K_M.gguf"
|
||||
$ModelPath = Join-Path -Path $ModelDir -ChildPath $ModelName
|
||||
$DownloadUrl2 = "https://huggingface.co/unsloth/Qwen3.5-2B-GGUF/resolve/main/Qwen3.5-2B-Q4_K_M.gguf?download=true"# 모델이 실제로는 Qwen3.5-0.8B 이므로 실제 유효한 HuggingFace URL
|
||||
if (Test-Path -Path $ModelPath) {
|
||||
Write-Host "`n[3.1] 언어 모델($Model1Name)이 이미 존재합니다. 다운로드를 건너뜁니다." -ForegroundColor Green
|
||||
}
|
||||
else {
|
||||
Write-Host "`n[3.1] 언어 모델($Model1Name) 다운로드 중... (용량이 크므로 시간이 걸릴 수 있습니다)" -ForegroundColor Yellow
|
||||
try {
|
||||
Invoke-WebRequest -Uri $DownloadUrl1 -OutFile $ModelPath
|
||||
Write-Host "모델 다운로드 완료!" -ForegroundColor Green
|
||||
}
|
||||
catch {
|
||||
Write-Host "모델 다운로드 실패. 아래 URL에서 수동으로 다운로드 후 $ModelDir 폴더 안에 배치해주세요." -ForegroundColor Red
|
||||
Write-Host "-> $DownloadUrl1" -ForegroundColor Yellow
|
||||
}
|
||||
}
|
||||
|
||||
if (Test-Path -Path $ModelPath) {
|
||||
Write-Host "`n[3.2] 언어 모델($Model2Name)이 이미 존재합니다. 다운로드를 건너뜁니다." -ForegroundColor Green
|
||||
}
|
||||
else {
|
||||
Write-Host "`n[3.2] 언어 모델($Model2Name) 다운로드 중... (용량이 크므로 시간이 걸릴 수 있습니다)" -ForegroundColor Yellow
|
||||
try {
|
||||
Invoke-WebRequest -Uri $DownloadUrl2 -OutFile $ModelPath
|
||||
Write-Host "모델 다운로드 완료!" -ForegroundColor Green
|
||||
}
|
||||
catch {
|
||||
Write-Host "모델 다운로드 실패. 아래 URL에서 수동으로 다운로드 후 $ModelDir 폴더 안에 배치해주세요." -ForegroundColor Red
|
||||
Write-Host "-> $DownloadUrl2" -ForegroundColor Yellow
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "`n=========================================" -ForegroundColor Cyan
|
||||
Write-Host " HUTAMS 셋업이 완료되었습니다! " -ForegroundColor Cyan
|
||||
Write-Host " 이제 run_server.ps1을 실행하여 서버를 시작하세요." -ForegroundColor Cyan
|
||||
Write-Host "=========================================" -ForegroundColor Cyan
|
||||
Loading…
Reference in New Issue