Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ariv/cli/arivctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ def cmd_start(host: str, port: int) -> None:
def cmd_bench(models: List[str], lang: str, subset: str) -> None:
from benchmarks.run_bench import run_benchmark

run_benchmark(models=models, lang=lang, subset=subset, output_dir=Path("benchmarks/results"))
run_benchmark(
models=models, lang=lang, subset=subset, output_dir=Path("benchmarks/results")
)


def cmd_download(dry_run: bool) -> None:
Expand Down
7 changes: 6 additions & 1 deletion ariv/orchestrator/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
"""Orchestration components."""

from ariv.orchestrator.router import HardwareProfile, ModelManager, RouteDecision, Router
from ariv.orchestrator.router import (
HardwareProfile,
ModelManager,
RouteDecision,
Router,
)

__all__ = ["HardwareProfile", "ModelManager", "RouteDecision", "Router"]
2 changes: 1 addition & 1 deletion ariv/orchestrator/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def _detect_indic(preferred_lang: Optional[str], text: str) -> bool:
if preferred_lang and preferred_lang.lower() in INDIC_LANGS:
return True
for char in text:
if "\u0900" <= char <= "\u0DFF":
if "\u0900" <= char <= "\u0dff":
return True
return False

Expand Down
8 changes: 6 additions & 2 deletions ariv/runner/llama_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,19 @@ async def _collect_stderr() -> None:
except json.JSONDecodeError:
yield line
continue
token = payload.get("token") or payload.get("content") or payload.get("text")
token = (
payload.get("token") or payload.get("content") or payload.get("text")
)
if token:
yield str(token)

await process.wait()
await stderr_task

if process.returncode != 0:
stderr_tail = b"".join(stderr_chunks).decode("utf-8", errors="replace").strip()
stderr_tail = (
b"".join(stderr_chunks).decode("utf-8", errors="replace").strip()
)
if len(stderr_tail) > 1200:
stderr_tail = stderr_tail[-1200:]
raise RuntimeError(
Expand Down
4 changes: 3 additions & 1 deletion ariv/scripts/convert_and_quantize.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ def main() -> None:
parser.add_argument("--hf-repo", required=True, help="Hugging Face repo path")
parser.add_argument("--output", required=True, help="Output GGUF path")
parser.add_argument("--quant", default="Q4_K_M", choices=["Q4_K_M", "Q5_0", "Q4_0"])
parser.add_argument("--llama-cpp", default="llama.cpp", help="Path to llama.cpp repo")
parser.add_argument(
"--llama-cpp", default="llama.cpp", help="Path to llama.cpp repo"
)
args = parser.parse_args()

llama_dir = Path(args.llama_cpp)
Expand Down
Loading