hermes-deploy commited on
Commit ·
fde0a94
1
Parent(s): d113ea5
v17 FINAL: Bangla voice via Groq whisper-large-v3-turbo + minimal net.json + UTC log filter
Browse files
__pycache__/gen_hermes_config.cpython-313.pyc
CHANGED
|
Binary files a/__pycache__/gen_hermes_config.cpython-313.pyc and b/__pycache__/gen_hermes_config.cpython-313.pyc differ
|
|
|
__pycache__/health_server.cpython-313.pyc
CHANGED
|
Binary files a/__pycache__/health_server.cpython-313.pyc and b/__pycache__/health_server.cpython-313.pyc differ
|
|
|
gen_hermes_config.py
CHANGED
|
@@ -51,7 +51,14 @@ custom_providers:
|
|
| 51 |
api_mode: chat_completions
|
| 52 |
|
| 53 |
stt:
|
| 54 |
-
enabled: true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
"""
|
| 56 |
|
| 57 |
# Normalize the relay to scheme://host ONLY. Whatever extra path the user
|
|
|
|
| 51 |
api_mode: chat_completions
|
| 52 |
|
| 53 |
stt:
|
| 54 |
+
enabled: true
|
| 55 |
+
"""
|
| 56 |
+
# Voice notes: cloud Groq Whisper (whisper-large-v3-turbo) understands
|
| 57 |
+
# Bangla + English code-switching and is free-fast. Language LEFT UNSET on
|
| 58 |
+
# purpose — auto-detect beats pinning bn/en when users mix both mid-sentence.
|
| 59 |
+
# Falls back to local faster-whisper when no GROQ_API_KEY secret is present.
|
| 60 |
+
if os.environ.get("GROQ_API_KEY", "").strip():
|
| 61 |
+
config_yaml += """ provider: groq # needs GROQ_API_KEY (free at console.groq.com)
|
| 62 |
"""
|
| 63 |
|
| 64 |
# Normalize the relay to scheme://host ONLY. Whatever extra path the user
|
health_server.py
CHANGED
|
@@ -62,14 +62,16 @@ def gate_tail(n: int = 200) -> str:
|
|
| 62 |
|
| 63 |
|
| 64 |
def _log_ts(ln):
|
| 65 |
-
"""Parse 'YYYY-MM-DD HH:MM:SS,uuu' at line start -> epoch, or None."""
|
| 66 |
import re as _re
|
| 67 |
from datetime import datetime as _dt
|
|
|
|
| 68 |
m = _re.match(r"^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3}", ln)
|
| 69 |
if not m:
|
| 70 |
return None
|
| 71 |
try:
|
| 72 |
-
|
|
|
|
| 73 |
except Exception:
|
| 74 |
return None
|
| 75 |
|
|
@@ -246,36 +248,13 @@ def router_probe():
|
|
| 246 |
|
| 247 |
|
| 248 |
def net_report():
|
| 249 |
-
|
|
|
|
| 250 |
targets = {
|
| 251 |
-
# controls / known-needed
|
| 252 |
"api.telegram.org (blocked, control)": "https://api.telegram.org/",
|
| 253 |
-
"openrouter (reachable, control)": "https://openrouter.ai/api/v1/models",
|
| 254 |
-
"api.groq.com (reachable, control)": "https://api.groq.com/openai/v1/models",
|
| 255 |
-
"generativelanguage.googleapis.com": "https://generativelanguage.googleapis.com/v1beta/models",
|
| 256 |
-
"router.huggingface.co": "https://router.huggingface.co/v1/models",
|
| 257 |
-
# the failed relay family
|
| 258 |
-
"workers.dev (blocked family)": "https://workers.dev/",
|
| 259 |
-
"pages.dev": "https://pages.dev/",
|
| 260 |
-
# candidate free FaaS/static hosts for the relay
|
| 261 |
-
"script.google.com (Apps Script)": "https://script.google.com/",
|
| 262 |
-
"script.googleusercontent.com": "https://script.googleusercontent.com/",
|
| 263 |
-
"vercel.app": "https://vercel.app/",
|
| 264 |
-
"api.vercel.com": "https://api.vercel.com/",
|
| 265 |
-
"netlify.app": "https://netlify.app/",
|
| 266 |
-
"deno.dev": "https://deno.dev/",
|
| 267 |
-
"deno.net": "https://deno.net/",
|
| 268 |
-
"fly.dev": "https://fly.dev/",
|
| 269 |
-
"onrender.com": "https://onrender.com/",
|
| 270 |
-
"koyeb.app": "https://koyeb.app/",
|
| 271 |
-
"glitch.me": "https://glitch.me/",
|
| 272 |
-
"pythonanywhere.com": "https://www.pythonanywhere.com/",
|
| 273 |
-
"supabase functions host": "https://supabase.co/",
|
| 274 |
-
# self-test: can spaces reach other spaces?
|
| 275 |
-
"another hf.space": "https://mdh-zone-openclow.hf.space/status.json",
|
| 276 |
}
|
|
|
|
| 277 |
if relay:
|
| 278 |
-
# probe the currently-configured relay URL too (whatever secret is set)
|
| 279 |
targets = {"⚡ current TELEGRAM_RELAY_URL": relay + "/healthz"} | targets
|
| 280 |
out = {}
|
| 281 |
for name, url in targets.items():
|
|
|
|
| 62 |
|
| 63 |
|
| 64 |
def _log_ts(ln):
|
| 65 |
+
"""Parse 'YYYY-MM-DD HH:MM:SS,uuu' at line start -> epoch (UTC), or None."""
|
| 66 |
import re as _re
|
| 67 |
from datetime import datetime as _dt
|
| 68 |
+
from calendar import timegm as _tgm
|
| 69 |
m = _re.match(r"^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3}", ln)
|
| 70 |
if not m:
|
| 71 |
return None
|
| 72 |
try:
|
| 73 |
+
d = _dt.strptime(m.group(0), "%Y-%m-%d %H:%M:%S,%f")
|
| 74 |
+
return _tgm(d.timetuple()) + d.microsecond / 1e6
|
| 75 |
except Exception:
|
| 76 |
return None
|
| 77 |
|
|
|
|
| 248 |
|
| 249 |
|
| 250 |
def net_report():
|
| 251 |
+
"""Minimal long-term diagnostics (the 22-host relay sweep served its
|
| 252 |
+
purpose during setup; keep this tiny and non-descriptive)."""
|
| 253 |
targets = {
|
|
|
|
| 254 |
"api.telegram.org (blocked, control)": "https://api.telegram.org/",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 255 |
}
|
| 256 |
+
relay = os.environ.get("TELEGRAM_RELAY_URL", "").strip()
|
| 257 |
if relay:
|
|
|
|
| 258 |
targets = {"⚡ current TELEGRAM_RELAY_URL": relay + "/healthz"} | targets
|
| 259 |
out = {}
|
| 260 |
for name, url in targets.items():
|