Spaces:
Configuration error
Configuration error
Launch evaluation workspace on existing Gradio hosting
Browse files- README.md +9 -3
- app.py +43 -0
- harnesslab_bundle.zip +1 -1
- manifest.json +1 -1
README.md
CHANGED
|
@@ -3,8 +3,10 @@ title: HarnessLab
|
|
| 3 |
emoji: 🧪
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: green
|
| 6 |
-
sdk:
|
| 7 |
-
|
|
|
|
|
|
|
| 8 |
pinned: false
|
| 9 |
short_description: Agent evaluation workspace with reproducible tool traces
|
| 10 |
---
|
|
@@ -23,10 +25,14 @@ short_description: Agent evaluation workspace with reproducible tool traces
|
|
| 23 |
|
| 24 |
## 배포 구조
|
| 25 |
|
| 26 |
-
|
|
|
|
|
|
|
| 27 |
`harnesslab_bundle.zip`은 검토된 앱·코어·시나리오·합성 평가 기록만 포함합니다.
|
| 28 |
`manifest.json`에서 포함 파일과 SHA-256을 확인할 수 있습니다.
|
| 29 |
로컬 가상환경, 인증 정보, 브라우저 데이터, 문서/발표 자료는 포함하지 않습니다.
|
|
|
|
|
|
|
| 30 |
|
| 31 |
## 실제 추론을 연결할 때
|
| 32 |
|
|
|
|
| 3 |
emoji: 🧪
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: green
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: 6.32.0
|
| 8 |
+
python_version: '3.12'
|
| 9 |
+
app_file: app.py
|
| 10 |
pinned: false
|
| 11 |
short_description: Agent evaluation workspace with reproducible tool traces
|
| 12 |
---
|
|
|
|
| 25 |
|
| 26 |
## 배포 구조
|
| 27 |
|
| 28 |
+
기존 무료 Gradio Space에서 Python 3.12 + FastAPI로 평가 UI와 기존 엔진을 실행합니다.
|
| 29 |
+
Gradio는 `/gradio` 경로에 마운트하며 기본 화면은 평가 워크스페이스입니다.
|
| 30 |
+
ZeroGPU 하드웨어 설정은 유지하지만 이번 앱은 GPU 함수를 호출하거나 모델을 로드하지 않습니다.
|
| 31 |
`harnesslab_bundle.zip`은 검토된 앱·코어·시나리오·합성 평가 기록만 포함합니다.
|
| 32 |
`manifest.json`에서 포함 파일과 SHA-256을 확인할 수 있습니다.
|
| 33 |
로컬 가상환경, 인증 정보, 브라우저 데이터, 문서/발표 자료는 포함하지 않습니다.
|
| 34 |
+
별도 CPU Docker Space를 사용할 수 있는 계정은 포함된 Dockerfile과 `sdk: docker`,
|
| 35 |
+
`app_port: 7860` 설정으로 같은 번들을 실행할 수 있습니다.
|
| 36 |
|
| 37 |
## 실제 추론을 연결할 때
|
| 38 |
|
app.py
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Gradio Space entrypoint for the packaged HarnessLab workspace."""
|
| 2 |
+
|
| 3 |
+
import hashlib
|
| 4 |
+
import json
|
| 5 |
+
import os
|
| 6 |
+
from pathlib import Path
|
| 7 |
+
import zipfile
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
def unpack_bundle(root: Path) -> None:
|
| 11 |
+
bundle = root / "harnesslab_bundle.zip"
|
| 12 |
+
manifest = json.loads((root / "manifest.json").read_text(encoding="utf-8"))
|
| 13 |
+
if hashlib.sha256(bundle.read_bytes()).hexdigest() != manifest["bundle_sha256"]:
|
| 14 |
+
raise ValueError("Bundle checksum mismatch")
|
| 15 |
+
with zipfile.ZipFile(bundle) as archive:
|
| 16 |
+
expected = {entry["path"]: entry["sha256"] for entry in manifest["files"]}
|
| 17 |
+
if set(archive.namelist()) != set(expected):
|
| 18 |
+
raise ValueError("Bundle file manifest mismatch")
|
| 19 |
+
for name in archive.namelist():
|
| 20 |
+
target = (root / name).resolve()
|
| 21 |
+
if not target.is_relative_to(root.resolve()):
|
| 22 |
+
raise ValueError("Invalid bundle member path")
|
| 23 |
+
if hashlib.sha256(archive.read(name)).hexdigest() != expected[name]:
|
| 24 |
+
raise ValueError("Bundle member checksum mismatch")
|
| 25 |
+
archive.extractall(root)
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
def main() -> None:
|
| 29 |
+
root = Path(__file__).resolve().parent
|
| 30 |
+
unpack_bundle(root)
|
| 31 |
+
os.environ.setdefault("GRADIO_ANALYTICS_ENABLED", "False")
|
| 32 |
+
import gradio as gr
|
| 33 |
+
import uvicorn
|
| 34 |
+
from space_app import app as workspace
|
| 35 |
+
|
| 36 |
+
with gr.Blocks(title="HarnessLab") as info:
|
| 37 |
+
gr.Markdown("# HarnessLab\n[평가 워크스페이스 열기](/)\n\n기존 평가 엔진을 실행하는 프로토타입입니다. GPU 추론은 포함하지 않습니다.")
|
| 38 |
+
application = gr.mount_gradio_app(workspace, info, path="/gradio")
|
| 39 |
+
uvicorn.run(application, host="0.0.0.0", port=7860, workers=1)
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
if __name__ == "__main__":
|
| 43 |
+
main()
|
harnesslab_bundle.zip
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 53363
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6b48b04d1872d55c7e494e586eabd85e3e276b6dc5170168926199383266220f
|
| 3 |
size 53363
|
manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"release": "HarnessLab Space Prototype",
|
| 3 |
-
"bundle_sha256": "
|
| 4 |
"files": [
|
| 5 |
{
|
| 6 |
"path": "harness/__init__.py",
|
|
|
|
| 1 |
{
|
| 2 |
"release": "HarnessLab Space Prototype",
|
| 3 |
+
"bundle_sha256": "6b48b04d1872d55c7e494e586eabd85e3e276b6dc5170168926199383266220f",
|
| 4 |
"files": [
|
| 5 |
{
|
| 6 |
"path": "harness/__init__.py",
|