Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1219089a3c
|
No files matched your search
+3
-1
@@ -51,7 +51,9 @@ The format follows [Keep a Changelog](https://keepachangelog.com/) and the proje
|
||||
worker with timestamp-midpoint trimming, enabling the progress stream
|
||||
and duration caps: 30 min on WebGPU, 10 min on WASM, 60 MB per file —
|
||||
no input can wedge the demo at an eternal "processing" state anymore.
|
||||
- A show/hide toggle (eye icon) on the login page's password field.
|
||||
|
||||
- `CONTRIBUTING.fa.md`: a Persian translation of the contribution guide,
|
||||
with a language switcher in both files like the READMEs (#31).
|
||||
|
||||
### Changed
|
||||
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
# مشارکت در سخن
|
||||
|
||||
[English](CONTRIBUTING.md) | **فارسی**
|
||||
|
||||
ممنون که به سخن سر زدید. این مخزن یک کیت گفتار به متنِ فارسی است که
|
||||
میشود سلفهاستش کرد: یک بکاند FastAPI با موتور faster-whisper، یک ورکر
|
||||
Celery، یک داشبورد Next.js (فارسیمحور و راستبهچپ)، یک ربات تلگرام
|
||||
اختیاری، یک پایپلاین فاینتیونِ LoRA با نتایجِ اندازهگیریشده، و یک دموی
|
||||
عمومیِ مرورگری روی Hugging Face.
|
||||
|
||||
## راهاندازی محیط توسعه
|
||||
|
||||
برای بکاند و ربات Python 3.12 و برای داشبورد وب Node 22 لازم است:
|
||||
|
||||
pip install -e "backend[dev]" -e "bot[dev]"
|
||||
cd web && npm ci
|
||||
|
||||
وابستگیهای سنگین (torch / faster-whisper) فقط برای ابزارهای آموزش و
|
||||
بنچمارک لازماند:
|
||||
|
||||
pip install -r training/requirements.txt -r benchmarks/requirements.txt
|
||||
pip install -r space/gradio/requirements.txt # self-hostable Gradio demo
|
||||
|
||||
## تستها، لینت و نظم کامیتها
|
||||
|
||||
CI روی هر push و pull request همین دستورها را اجرا میکند:
|
||||
|
||||
ruff check backend bot training benchmarks space deploy
|
||||
mypy --config-file backend/pyproject.toml backend/sokhan
|
||||
pytest backend/tests bot/tests
|
||||
cd web && npm ci && npm run build
|
||||
|
||||
هوکهای pre-commit (ruff بهعلاوهٔ چند بررسی پایه) را برای هر کلون یک بار
|
||||
فعال کنید:
|
||||
|
||||
pip install pre-commit && pre-commit install
|
||||
|
||||
پیام کامیتها از Conventional Commits پیروی میکنند (`feat:`، `fix:`،
|
||||
`docs:`، ...) و نسخهگذاری پروژه بر اساس Semantic Versioning است؛ هر
|
||||
تغییری که کاربر میبیند یک خط در CHANGELOG.md میگیرد.
|
||||
|
||||
## دموی مرورگری و ورکفلوی sync-space
|
||||
|
||||
`space/` دموی استاتیکی است که Whisper در آن کاملاً سمتِ مرورگر اجرا
|
||||
میشود (transformers.js). ورکفلوی `Sync demo Space` با هر pushای که به
|
||||
`space/` دست بزند، آن را با سکرتِ `HF_TOKEN` در Actions مخزن روی
|
||||
hf.co/spaces/Abol0pati/sokhan-fa-demo منتشر میکند - برای همین دموی
|
||||
عمومی هیچوقت از `main` عقب نمیماند. `space/gradio/` یک اپ جدا و
|
||||
سلفهاستشدنی است که چکپوینتِ فاینتیونشده را با همان تنظیمات موتورِ
|
||||
محیط production سرو میکند؛ این اپ عمداً روی Space عمومی آپلود نمیشود
|
||||
(قیمتگذاری ۲۰۲۶ هاگینگفیس، Spaceهای میزبانیشدهٔ Gradio/Docker را پشت
|
||||
اشتراک PRO قفل کرده است).
|
||||
|
||||
## قاعدهٔ «اول اندازهگیری»
|
||||
|
||||
هر ادعایی دربارهٔ دقت (WER، CER، سرعت) که در README، کارت مدل یا
|
||||
changelog میآید باید از `benchmarks/benchmark_wer.py` (یا ارزیابیِ
|
||||
نوتبوک) آمده باشد و فیکسچر و سختافزارش ذکر شده باشد. هیچ عددِ ساختگی
|
||||
پذیرفته نیست.
|
||||
|
||||
## امنیت
|
||||
|
||||
گزارشهای امنیتی را بهصورت issue عمومی باز نکنید - برای افشای خصوصی
|
||||
SECURITY.md را ببینید.
|
||||
@@ -1,5 +1,7 @@
|
||||
# Contributing to Sokhan
|
||||
|
||||
**English** | [فارسی](CONTRIBUTING.fa.md)
|
||||
|
||||
Thanks for looking into Sokhan. This repo is a self-hostable Persian
|
||||
speech-to-text kit: a FastAPI backend with a faster-whisper engine, a
|
||||
Celery worker, a Next.js (Persian-first, RTL) dashboard, an optional
|
||||
|
||||
@@ -53,8 +53,6 @@
|
||||
"emailPlaceholder": "you@example.com",
|
||||
"passwordLabel": "Password",
|
||||
"passwordPlaceholder": "••••••••",
|
||||
"showPassword": "Show password",
|
||||
"hidePassword": "Hide password",
|
||||
"codeLabel": "Connect code",
|
||||
"codePlaceholder": "Enter your connect code",
|
||||
"codeHint": "Have a connect code? No email or password needed.",
|
||||
|
||||
@@ -53,8 +53,6 @@
|
||||
"emailPlaceholder": "you@example.com",
|
||||
"passwordLabel": "رمز عبور",
|
||||
"passwordPlaceholder": "••••••••",
|
||||
"showPassword": "نمایش رمز عبور",
|
||||
"hidePassword": "پنهان کردن رمز عبور",
|
||||
"codeLabel": "کد اتصال",
|
||||
"codePlaceholder": "کد اتصال را وارد کن",
|
||||
"codeHint": "اگر کد اتصال داری، لازم نیست ایمیل و رمز عبور وارد کنی.",
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import { useState, type FormEvent } from "react";
|
||||
import { useTranslations } from "next-intl";
|
||||
import { Eye, EyeOff } from "lucide-react";
|
||||
import { useRouter } from "@/i18n/navigation";
|
||||
import { ApiError, login, register, setToken, tokenLogin } from "@/lib/api";
|
||||
|
||||
@@ -18,7 +17,6 @@ export default function LoginPage() {
|
||||
const [mode, setMode] = useState<Mode>("login");
|
||||
const [email, setEmail] = useState("");
|
||||
const [password, setPassword] = useState("");
|
||||
const [showPassword, setShowPassword] = useState(false);
|
||||
const [code, setCode] = useState("");
|
||||
const [emailError, setEmailError] = useState<string | null>(null);
|
||||
const [passwordError, setPasswordError] = useState<string | null>(null);
|
||||
@@ -29,7 +27,6 @@ export default function LoginPage() {
|
||||
function switchMode(next: Mode) {
|
||||
if (next === mode) return;
|
||||
setMode(next);
|
||||
setShowPassword(false);
|
||||
setEmailError(null);
|
||||
setPasswordError(null);
|
||||
setCodeError(null);
|
||||
@@ -179,39 +176,21 @@ export default function LoginPage() {
|
||||
>
|
||||
{t("passwordLabel")}
|
||||
</label>
|
||||
{/* The field is always LTR, so the toggle sits at its physical right. */}
|
||||
<div className="relative" dir="ltr">
|
||||
<input
|
||||
id="login-password"
|
||||
name="password"
|
||||
type={showPassword ? "text" : "password"}
|
||||
dir="ltr"
|
||||
autoComplete={mode === "register" ? "new-password" : "current-password"}
|
||||
value={password}
|
||||
onChange={(event) => {
|
||||
setPassword(event.target.value);
|
||||
if (passwordError) setPasswordError(null);
|
||||
}}
|
||||
placeholder={t("passwordPlaceholder")}
|
||||
aria-invalid={passwordError ? true : undefined}
|
||||
className={`${inputClasses} pr-11`}
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setShowPassword((shown) => !shown)}
|
||||
aria-label={showPassword ? t("hidePassword") : t("showPassword")}
|
||||
aria-pressed={showPassword}
|
||||
aria-controls="login-password"
|
||||
title={showPassword ? t("hidePassword") : t("showPassword")}
|
||||
className="absolute inset-y-0 right-0 flex w-11 items-center justify-center rounded-e-lg text-stone-500 transition-colors hover:text-stone-800 focus-visible:ring-2 focus-visible:ring-teal-700"
|
||||
>
|
||||
{showPassword ? (
|
||||
<EyeOff className="h-5 w-5" aria-hidden="true" />
|
||||
) : (
|
||||
<Eye className="h-5 w-5" aria-hidden="true" />
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
<input
|
||||
id="login-password"
|
||||
name="password"
|
||||
type="password"
|
||||
dir="ltr"
|
||||
autoComplete={mode === "register" ? "new-password" : "current-password"}
|
||||
value={password}
|
||||
onChange={(event) => {
|
||||
setPassword(event.target.value);
|
||||
if (passwordError) setPasswordError(null);
|
||||
}}
|
||||
placeholder={t("passwordPlaceholder")}
|
||||
aria-invalid={passwordError ? true : undefined}
|
||||
className={inputClasses}
|
||||
/>
|
||||
{passwordError ? (
|
||||
<p className="mt-1.5 text-sm text-red-700">{passwordError}</p>
|
||||
) : mode === "register" ? (
|
||||
|
||||
Reference in new issue
Block a user