Spaces:
Paused
Paused
tune+ux: z-thresh 1.8 + new examples + 'development practices' copy (app.py)
Browse files
app.py
CHANGED
|
@@ -15,23 +15,6 @@ proportional to actual model work.
|
|
| 15 |
from __future__ import annotations
|
| 16 |
|
| 17 |
import os
|
| 18 |
-
|
| 19 |
-
# `import spaces` MUST come before any module that imports torch β the
|
| 20 |
-
# spaces package installs a torch CUDA-emulation patch at import time,
|
| 21 |
-
# and if torch has already loaded the patch can't take. Symptom of
|
| 22 |
-
# getting this wrong on ZeroGPU: worker_init fails with
|
| 23 |
-
# RuntimeError: No CUDA GPUs are available
|
| 24 |
-
# at torch.init(nvidia_uuid). Keep this block above the imports below.
|
| 25 |
-
#
|
| 26 |
-
# Set USE_SPACES_GPU=false on persistent paid-GPU Spaces (h200,
|
| 27 |
-
# a10g-small, etc.) where the decorator isn't needed.
|
| 28 |
-
USE_SPACES_GPU = os.environ.get("USE_SPACES_GPU", "true").lower() in ("true", "1", "yes")
|
| 29 |
-
if USE_SPACES_GPU:
|
| 30 |
-
import spaces
|
| 31 |
-
_gpu_decorator = spaces.GPU(duration=60)
|
| 32 |
-
else:
|
| 33 |
-
_gpu_decorator = lambda f: f
|
| 34 |
-
|
| 35 |
import time
|
| 36 |
import traceback
|
| 37 |
from typing import Any
|
|
@@ -45,6 +28,21 @@ import confidence
|
|
| 45 |
import model_io
|
| 46 |
import team_context
|
| 47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
# Loaded at cold-start (CPU). The GPU model is loaded inside the
|
| 49 |
# scoring function on first invocation.
|
| 50 |
EMBEDDER_PRELOAD = candidate_filter.load_embedder()
|
|
@@ -157,18 +155,17 @@ def _format_result(result: dict, team_ctx: str, elapsed_s: float) -> tuple[str,
|
|
| 157 |
# generalist; don't push hard, but keep the upsell visible.
|
| 158 |
confidence_md += (
|
| 159 |
"\n\n---\n\n"
|
| 160 |
-
"_Want
|
| 161 |
-
"specific reading patterns?_\n\n"
|
| 162 |
f"{cta_button}"
|
| 163 |
)
|
| 164 |
else:
|
| 165 |
# Prominent CTA β user saw the generalist's limits (moderate /
|
| 166 |
# low / noise tier). Personalized scoring directly addresses the
|
| 167 |
-
# cause: a model adapted to
|
| 168 |
confidence_md += (
|
| 169 |
"\n\n---\n\n"
|
| 170 |
"### Get sharper recommendations on this repo\n\n"
|
| 171 |
-
"A personalized model
|
| 172 |
"typically lifts confidence by **10-15pts** on team-specific picks β "
|
| 173 |
"and produces PR drafts that match your team's actual engineering style.\n\n"
|
| 174 |
f"{cta_button}"
|
|
@@ -281,8 +278,8 @@ with gr.Blocks(title="Feature Finder", theme="soft") as demo:
|
|
| 281 |
"a PR-ready spec (summary, motivation, implementation plan, open "
|
| 282 |
"questions) that a coding agent can pick up and run with.\n\n"
|
| 283 |
"Free preview using our open-source generalist scorer (LoRA on "
|
| 284 |
-
"Qwen3.5-2B). For
|
| 285 |
-
"
|
| 286 |
'<a href="https://engine.remyx.ai" target="_blank" '
|
| 287 |
'style="color:#ff6b35;font-weight:600;text-decoration:underline;">'
|
| 288 |
"sign up at engine.remyx.ai</a>.",
|
|
@@ -315,17 +312,20 @@ with gr.Blocks(title="Feature Finder", theme="soft") as demo:
|
|
| 315 |
|
| 316 |
gr.Examples(
|
| 317 |
examples=[
|
| 318 |
-
# Remyx's own β multimodal data synthesis; demos the moderate
|
| 319 |
-
#
|
| 320 |
"https://github.com/remyxai/VQASynth",
|
| 321 |
-
#
|
| 322 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 323 |
# Hyperparameter optimization library β less mainstream, tests
|
| 324 |
-
# the LLM-training/ML adjacency
|
|
|
|
| 325 |
"https://github.com/hyperactive-project/Hyperactive",
|
| 326 |
-
# Rust + React coding assistant β niche but in active development;
|
| 327 |
-
# good cross-domain test.
|
| 328 |
-
"https://github.com/amrit110/oli",
|
| 329 |
],
|
| 330 |
inputs=[repo_input],
|
| 331 |
)
|
|
|
|
| 15 |
from __future__ import annotations
|
| 16 |
|
| 17 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
import time
|
| 19 |
import traceback
|
| 20 |
from typing import Any
|
|
|
|
| 28 |
import model_io
|
| 29 |
import team_context
|
| 30 |
|
| 31 |
+
# The @spaces.GPU decorator is for Zero-GPU Spaces only β it spawns a
|
| 32 |
+
# worker process that requests a GPU from the Zero-GPU pool. On
|
| 33 |
+
# persistent paid GPU Spaces (h200, a10g-small, etc.), the GPU is
|
| 34 |
+
# always attached to the main container; the decorator would either be
|
| 35 |
+
# a no-op or fail at worker-init.
|
| 36 |
+
#
|
| 37 |
+
# Set USE_SPACES_GPU=false on persistent GPU Spaces. Default true so
|
| 38 |
+
# Zero-GPU deployments keep working unchanged.
|
| 39 |
+
USE_SPACES_GPU = os.environ.get("USE_SPACES_GPU", "true").lower() in ("true", "1", "yes")
|
| 40 |
+
if USE_SPACES_GPU:
|
| 41 |
+
import spaces
|
| 42 |
+
_gpu_decorator = spaces.GPU(duration=60)
|
| 43 |
+
else:
|
| 44 |
+
_gpu_decorator = lambda f: f # no-op on persistent GPU
|
| 45 |
+
|
| 46 |
# Loaded at cold-start (CPU). The GPU model is loaded inside the
|
| 47 |
# scoring function on first invocation.
|
| 48 |
EMBEDDER_PRELOAD = candidate_filter.load_embedder()
|
|
|
|
| 155 |
# generalist; don't push hard, but keep the upsell visible.
|
| 156 |
confidence_md += (
|
| 157 |
"\n\n---\n\n"
|
| 158 |
+
"_Want recommendations tailored to your team's development practices?_\n\n"
|
|
|
|
| 159 |
f"{cta_button}"
|
| 160 |
)
|
| 161 |
else:
|
| 162 |
# Prominent CTA β user saw the generalist's limits (moderate /
|
| 163 |
# low / noise tier). Personalized scoring directly addresses the
|
| 164 |
+
# cause: a model adapted to the team's development practices.
|
| 165 |
confidence_md += (
|
| 166 |
"\n\n---\n\n"
|
| 167 |
"### Get sharper recommendations on this repo\n\n"
|
| 168 |
+
"A personalized model tailored to your team's development practices "
|
| 169 |
"typically lifts confidence by **10-15pts** on team-specific picks β "
|
| 170 |
"and produces PR drafts that match your team's actual engineering style.\n\n"
|
| 171 |
f"{cta_button}"
|
|
|
|
| 278 |
"a PR-ready spec (summary, motivation, implementation plan, open "
|
| 279 |
"questions) that a coding agent can pick up and run with.\n\n"
|
| 280 |
"Free preview using our open-source generalist scorer (LoRA on "
|
| 281 |
+
"Qwen3.5-2B). For recommendations tailored to your team's "
|
| 282 |
+
"development practices: "
|
| 283 |
'<a href="https://engine.remyx.ai" target="_blank" '
|
| 284 |
'style="color:#ff6b35;font-weight:600;text-decoration:underline;">'
|
| 285 |
"sign up at engine.remyx.ai</a>.",
|
|
|
|
| 312 |
|
| 313 |
gr.Examples(
|
| 314 |
examples=[
|
| 315 |
+
# Remyx's own β multimodal data synthesis; demos the moderate
|
| 316 |
+
# tier on a real internal repo + the CTA value-prop.
|
| 317 |
"https://github.com/remyxai/VQASynth",
|
| 318 |
+
# Popular multi-agent framework β recognizable to most ML devs,
|
| 319 |
+
# typically lands high tier with STORM-style multi-agent papers.
|
| 320 |
+
"https://github.com/microsoft/autogen",
|
| 321 |
+
# Popular RAG / data-indexing framework β strong high-tier
|
| 322 |
+
# demo case; relevant retrieval-augmented papers are dense
|
| 323 |
+
# in the pool.
|
| 324 |
+
"https://github.com/run-llama/llama_index",
|
| 325 |
# Hyperparameter optimization library β less mainstream, tests
|
| 326 |
+
# the LLM-training/ML adjacency and demos honest low-tier
|
| 327 |
+
# behavior on niche subdomains.
|
| 328 |
"https://github.com/hyperactive-project/Hyperactive",
|
|
|
|
|
|
|
|
|
|
| 329 |
],
|
| 330 |
inputs=[repo_input],
|
| 331 |
)
|