SissiFeng commited on
Commit
a79afc4
·
1 Parent(s): cdb8847

Update code and documentation

Browse files
.gitattributes ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tflite filter=lfs diff=lfs merge=lfs -text
29
+ *.tgz filter=lfs diff=lfs merge=lfs -text
30
+ *.wasm filter=lfs diff=lfs merge=lfs -text
31
+ *.xz filter=lfs diff=lfs merge=lfs -text
32
+ *.zip filter=lfs diff=lfs merge=lfs -text
33
+ *.zst filter=lfs diff=lfs merge=lfs -text
34
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
.history/.gitattributes_20250420181333 ADDED
@@ -0,0 +1 @@
 
 
1
+
.history/.gitattributes_20250420181336 ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tflite filter=lfs diff=lfs merge=lfs -text
29
+ *.tgz filter=lfs diff=lfs merge=lfs -text
30
+ *.wasm filter=lfs diff=lfs merge=lfs -text
31
+ *.xz filter=lfs diff=lfs merge=lfs -text
32
+ *.zip filter=lfs diff=lfs merge=lfs -text
33
+ *.zst filter=lfs diff=lfs merge=lfs -text
34
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
.history/.gitattributes_20250420181337 ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tflite filter=lfs diff=lfs merge=lfs -text
29
+ *.tgz filter=lfs diff=lfs merge=lfs -text
30
+ *.wasm filter=lfs diff=lfs merge=lfs -text
31
+ *.xz filter=lfs diff=lfs merge=lfs -text
32
+ *.zip filter=lfs diff=lfs merge=lfs -text
33
+ *.zst filter=lfs diff=lfs merge=lfs -text
34
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
.history/README_20250420181308.md ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Hugging Face Experiment Control Panel
2
+
3
+ This is a proxy control panel based on FastAPI (backend) and a simple web UI (frontend) to provide remote control and monitoring capabilities for experiment workflows on Hugging Face.
4
+
5
+ [![Hugging Face Spaces](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/SissiFeng/HF_catalyst)
6
+
7
+ ## Features
8
+
9
+ - 🔄 **Workflow Upload & Submission**: Drag & drop or select JSON workflow files and send them to the lab server
10
+ - 📊 **Execution Visualization**: Real-time display of workflow execution steps and status
11
+ - 🔍 **Server Status Monitoring**: Real-time check if the lab server is online
12
+ - 📝 **History Management**: Save sent workflows for quick resubmission
13
+ - 🐞 **Debug Console**: Centralized display of error messages and system logs
14
+
15
+ ## System Architecture
16
+
17
+ - **Frontend**: Simple Web UI with JavaScript
18
+ - **Backend**: FastAPI (Python)
19
+ - **Communication**: REST API request forwarding
20
+
21
+ ## Environment Variables
22
+
23
+ - `LAB_SERVER_URL`: URL of the lab server (default: http://localhost:8000)
24
+ - `PORT`: Port for the application to run on (default: 8080)
25
+
26
+ ## Local Development
27
+
28
+ 1. Install dependencies:
29
+
30
+ ```bash
31
+ pip install -r requirements.txt
32
+ ```
33
+
34
+ 2. Start the service:
35
+
36
+ ```bash
37
+ python app.py
38
+ ```
39
+
40
+ 3. Access the application:
41
+
42
+ Open your browser and go to `http://localhost:8080`
43
+
44
+ ## Project Structure
45
+
46
+ ```
47
+ project-root/
48
+ ├── app.py # FastAPI proxy backend
49
+ ├── requirements.txt # Python dependencies
50
+ ├── static/ # Static pages
51
+ │ └── index.html # Main HTML page
52
+ ├── public/ # Public resources
53
+ │ └── logo.png # App logo
54
+ └── frontend/ # Frontend code (for reference only)
55
+ ├── App.tsx # Main app container
56
+ ├── index.tsx # React entry point
57
+ ├── api/
58
+ │ └── apiClient.ts # API request encapsulation
59
+ ├── components/
60
+ │ ├── WorkflowSender.tsx # Workflow upload/send component
61
+ │ ├── RunStatusStepper.tsx # Execution progress visualization
62
+ │ ├── PingLabServer.tsx # Server status check
63
+ │ ├── HistoryPanel.tsx # History management
64
+ │ └── ErrorConsole.tsx # Error and log display
65
+ └── types/
66
+ └── types.ts # TypeScript type definitions
67
+ ```
68
+
69
+ ## API Endpoints
70
+
71
+ - `GET /api/health`: Check if the lab server is online
72
+ - `POST /api/run_experiment`: Submit workflow execution request
73
+ - `GET /api/run_status/{run_id}`: Get workflow execution status
74
+ - `GET /api/sample_workflow`: Get a sample workflow (demo only)
75
+
76
+ ## License
77
+
78
+ MIT
.history/README_20250420181314.md ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Hugging Face Experiment Control Panel
2
+
3
+ This is a proxy control panel based on FastAPI (backend) and a simple web UI (frontend) to provide remote control and monitoring capabilities for experiment workflows on Hugging Face.
4
+
5
+ [![Hugging Face Spaces](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/SissiFeng/HF_catalyst)
6
+
7
+ ## Features
8
+
9
+ - 🔄 **Workflow Upload & Submission**: Drag & drop or select JSON workflow files and send them to the lab server
10
+ - 📊 **Execution Visualization**: Real-time display of workflow execution steps and status
11
+ - 🔍 **Server Status Monitoring**: Real-time check if the lab server is online
12
+ - 📝 **History Management**: Save sent workflows for quick resubmission
13
+ - 🐞 **Debug Console**: Centralized display of error messages and system logs
14
+
15
+ ## System Architecture
16
+
17
+ - **Frontend**: Simple Web UI with JavaScript
18
+ - **Backend**: FastAPI (Python)
19
+ - **Communication**: REST API request forwarding
20
+
21
+ ## Environment Variables
22
+
23
+ - `LAB_SERVER_URL`: URL of the lab server (default: http://localhost:8000)
24
+ - `PORT`: Port for the application to run on (default: 8080)
25
+
26
+ ## Local Development
27
+
28
+ 1. Install dependencies:
29
+
30
+ ```bash
31
+ pip install -r requirements.txt
32
+ ```
33
+
34
+ 2. Start the service:
35
+
36
+ ```bash
37
+ python app.py
38
+ ```
39
+
40
+ 3. Access the application:
41
+
42
+ Open your browser and go to `http://localhost:8080`
43
+
44
+ ## Project Structure
45
+
46
+ ```
47
+ project-root/
48
+ ├── app.py # FastAPI proxy backend
49
+ ├── requirements.txt # Python dependencies
50
+ ├── static/ # Static pages
51
+ │ └── index.html # Main HTML page
52
+ ├── public/ # Public resources
53
+ │ └── logo.png # App logo
54
+ └── frontend/ # Frontend code (for reference only)
55
+ ├── App.tsx # Main app container
56
+ ├── index.tsx # React entry point
57
+ ├── api/
58
+ │ └── apiClient.ts # API request encapsulation
59
+ ├── components/
60
+ │ ├── WorkflowSender.tsx # Workflow upload/send component
61
+ │ ├── RunStatusStepper.tsx # Execution progress visualization
62
+ │ ├── PingLabServer.tsx # Server status check
63
+ │ ├── HistoryPanel.tsx # History management
64
+ │ └── ErrorConsole.tsx # Error and log display
65
+ └── types/
66
+ └── types.ts # TypeScript type definitions
67
+ ```
68
+
69
+ ## API Endpoints
70
+
71
+ - `GET /api/health`: Check if the lab server is online
72
+ - `POST /api/run_experiment`: Submit workflow execution request
73
+ - `GET /api/run_status/{run_id}`: Get workflow execution status
74
+ - `GET /api/sample_workflow`: Get a sample workflow (demo only)
75
+
76
+ ## License
77
+
78
+ MIT
.history/README_20250420181323.md ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Hugging Face Experiment Control Panel
2
+
3
+ This is a proxy control panel based on FastAPI (backend) and a simple web UI (frontend) to provide remote control and monitoring capabilities for experiment workflows on Hugging Face.
4
+
5
+ [![Hugging Face Spaces](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/SissiFeng/HF_catalyst)
6
+
7
+ ## Features
8
+
9
+ - 🔄 **Workflow Upload & Submission**: Drag & drop or select JSON workflow files and send them to the lab server
10
+ - 📊 **Execution Visualization**: Real-time display of workflow execution steps and status
11
+ - 🔍 **Server Status Monitoring**: Real-time check if the lab server is online
12
+ - 📝 **History Management**: Save sent workflows for quick resubmission
13
+ - 🐞 **Debug Console**: Centralized display of error messages and system logs
14
+
15
+ ## System Architecture
16
+
17
+ - **Frontend**: Simple Web UI with JavaScript
18
+ - **Backend**: FastAPI (Python)
19
+ - **Communication**: REST API request forwarding
20
+
21
+ ## Environment Variables
22
+
23
+ - `LAB_SERVER_URL`: URL of the lab server (default: http://localhost:8000)
24
+ - `PORT`: Port for the application to run on (default: 8080)
25
+
26
+ ## Local Development
27
+
28
+ 1. Install dependencies:
29
+
30
+ ```bash
31
+ pip install -r requirements.txt
32
+ ```
33
+
34
+ 2. Start the service:
35
+
36
+ ```bash
37
+ python app.py
38
+ ```
39
+
40
+ 3. Access the application:
41
+
42
+ Open your browser and go to `http://localhost:8080`
43
+
44
+ ## Project Structure
45
+
46
+ ```
47
+ project-root/
48
+ ├── app.py # FastAPI proxy backend
49
+ ├── requirements.txt # Python dependencies
50
+ ├── static/ # Static pages
51
+ │ └── index.html # Main HTML page
52
+ ├── public/ # Public resources
53
+ │ └── logo.png # App logo
54
+ └── frontend/ # Frontend code (for reference only)
55
+ ├── App.tsx # Main app container
56
+ ├── index.tsx # React entry point
57
+ ├── api/
58
+ │ └── apiClient.ts # API request encapsulation
59
+ ├── components/
60
+ │ ├── WorkflowSender.tsx # Workflow upload/send component
61
+ │ ├── RunStatusStepper.tsx # Execution progress visualization
62
+ │ ├── PingLabServer.tsx # Server status check
63
+ │ ├── HistoryPanel.tsx # History management
64
+ │ └── ErrorConsole.tsx # Error and log display
65
+ └── types/
66
+ └── types.ts # TypeScript type definitions
67
+ ```
68
+
69
+ ## API Endpoints
70
+
71
+ - `GET /api/health`: Check if the lab server is online
72
+ - `POST /api/run_experiment`: Submit workflow execution request
73
+ - `GET /api/run_status/{run_id}`: Get workflow execution status
74
+ - `GET /api/sample_workflow`: Get a sample workflow (demo only)
75
+
76
+ ## License
77
+
78
+ MIT
.history/create_space_20250420181218.py ADDED
@@ -0,0 +1 @@
 
 
1
+
.history/create_space_20250420181221.py ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from huggingface_hub import create_repo, get_full_repo_name
2
+ import os
3
+ import sys
4
+
5
+ # 获取Space名称
6
+ if len(sys.argv) > 1:
7
+ space_name = sys.argv[1]
8
+ else:
9
+ space_name = input("Enter your Space name (e.g. hf-proxy-panel): ")
10
+
11
+ # 创建新的Space
12
+ try:
13
+ repo_id = create_repo(
14
+ space_name,
15
+ repo_type="space",
16
+ space_sdk="gradio", # 这里有几个选项:gradio, streamlit, docker, static
17
+ space_hardware="cpu-basic", # cpu-basic是免费的,其他选项包括cpu-upgrade, t4-small, a10g-small等
18
+ private=False
19
+ )
20
+ print(f"✓ Space created successfully: {repo_id}")
21
+
22
+ # 获取远程仓库URL
23
+ username = repo_id.split('/')[0]
24
+ full_repo_name = get_full_repo_name(space_name, token=None, organization=None)
25
+ git_url = f"https://huggingface.co/spaces/{full_repo_name}"
26
+
27
+ print(f"\nTo add the remote repository and push your code, run:")
28
+ print(f"git remote add origin https://huggingface.co/spaces/{full_repo_name}")
29
+ print(f"git push -u origin main")
30
+
31
+ print(f"\nYour Space will be available at: {git_url}")
32
+
33
+ except Exception as e:
34
+ print(f"✗ Error creating Space: {str(e)}")
35
+ sys.exit(1)
README.md CHANGED
@@ -1,113 +1,78 @@
1
- # Hugging Face 实验控制面板
2
 
3
- 这是一个基于 FastAPI(后端)和 React(前端)的代理控制面板,用于在 Hugging Face 上提供实验流程的远程控制和监控功能。
4
 
5
- ## 功能特点
6
 
7
- - 🔄 **工作流上传与发送**: 拖放或选择 JSON 工作流文件并发送到实验室服务器
8
- - 📊 **执行进度可视化**: 实时显示工作流执行步骤和状态
9
- - 🔍 **服务器状态监控**: 实时检查实验室服务器是否在线
10
- - 📝 **历史记录管理**: 保存已发送的工作流,支持快速重新提交
11
- - 🐞 **错误调试控制台**: 集中显示错误信息和系统日志
12
 
13
- ## 系统架构
 
 
 
 
14
 
15
- - **前端**: React + TypeScript
16
- - **后端**: FastAPI (Python)
17
- - **通信**: REST API 请求转发
18
 
19
- ## 快速开始
 
 
20
 
21
- ### 环境变量
22
 
23
- - `LAB_SERVER_URL`: 实验室服务器的 URL(默认: http://localhost:8000
24
- - `PORT`: 应用运行的端口(默认: 8080
25
 
26
- ### 本地运行
27
 
28
- 1. 安装依赖:
29
 
30
  ```bash
31
  pip install -r requirements.txt
32
  ```
33
 
34
- 2. 启动服务:
35
 
36
  ```bash
37
  python app.py
38
  ```
39
 
40
- 3. 访问应用:
41
 
42
- 浏览器打开 `http://localhost:8080`
43
 
44
- ### Hugging Face Space 部署
45
-
46
- 1. 克隆此仓库
47
- 2. 在 Hugging Face 上创建新的 Space (类型: Gradio)
48
- 3. 上传仓库内容到 Space
49
- 4. 设置环境变量 `LAB_SERVER_URL` 指向您的实验室服务器
50
-
51
- ## 项目结构
52
 
53
  ```
54
  project-root/
55
- ├── app.py # FastAPI 代理后端
56
- ├── requirements.txt # Python 依赖
57
- ├── static/ # 静态页面
58
- │ └── index.html # HTML 页面
59
- ├── public/ # 公共资源
60
- │ └── logo.png # 应用 Logo
61
- ── frontend/ # 前端代码
62
- ├── App.tsx # 应用主容器
63
- ├── index.tsx # React 入口
64
- ├── api/
65
- └── apiClient.ts # API 请求封装
66
- ├── components/
67
- ├── WorkflowSender.tsx # 工作流上传/发送组件
68
- ├── RunStatusStepper.tsx # 执行进度可视化
69
- ├── PingLabServer.tsx # 服务器状态检查
70
- ├── HistoryPanel.tsx # 历史记录管理
71
- └── ErrorConsole.tsx # 错误和日志显示
72
- └── types/
73
- └── types.ts # TypeScript 类型定义
74
- └── .gitignore # Git 忽略配置
75
  ```
76
 
77
- ## API 接口
78
-
79
- - `GET /api/health`: 检查实验室服务器��否在线
80
- - `POST /api/run_experiment`: 提交工作流执行请求
81
- - `GET /api/run_status/{run_id}`: 获取工作流执行状态
82
-
83
- ## 工作流 JSON 格式
84
-
85
- 工作流 JSON 应包含以下结构:
86
-
87
- ```json
88
- {
89
- "name": "工作流名称",
90
- "description": "工作流描述",
91
- "nodes": [
92
- {
93
- "id": "node1",
94
- "label": "节点1",
95
- "type": "process",
96
- "parameters": {
97
- "param1": "value1"
98
- }
99
- }
100
- ],
101
- "edges": [
102
- {
103
- "id": "edge1",
104
- "source": "node1",
105
- "target": "node2"
106
- }
107
- ]
108
- }
109
- ```
110
 
111
- ## 许可证
112
 
113
  MIT
 
1
+ # Hugging Face Experiment Control Panel
2
 
3
+ This is a proxy control panel based on FastAPI (backend) and a simple web UI (frontend) to provide remote control and monitoring capabilities for experiment workflows on Hugging Face.
4
 
5
+ [![Hugging Face Spaces](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/SissiFeng/HF_catalyst)
6
 
7
+ ## Features
 
 
 
 
8
 
9
+ - 🔄 **Workflow Upload & Submission**: Drag & drop or select JSON workflow files and send them to the lab server
10
+ - 📊 **Execution Visualization**: Real-time display of workflow execution steps and status
11
+ - 🔍 **Server Status Monitoring**: Real-time check if the lab server is online
12
+ - 📝 **History Management**: Save sent workflows for quick resubmission
13
+ - 🐞 **Debug Console**: Centralized display of error messages and system logs
14
 
15
+ ## System Architecture
 
 
16
 
17
+ - **Frontend**: Simple Web UI with JavaScript
18
+ - **Backend**: FastAPI (Python)
19
+ - **Communication**: REST API request forwarding
20
 
21
+ ## Environment Variables
22
 
23
+ - `LAB_SERVER_URL`: URL of the lab server (default: http://localhost:8000)
24
+ - `PORT`: Port for the application to run on (default: 8080)
25
 
26
+ ## Local Development
27
 
28
+ 1. Install dependencies:
29
 
30
  ```bash
31
  pip install -r requirements.txt
32
  ```
33
 
34
+ 2. Start the service:
35
 
36
  ```bash
37
  python app.py
38
  ```
39
 
40
+ 3. Access the application:
41
 
42
+ Open your browser and go to `http://localhost:8080`
43
 
44
+ ## Project Structure
 
 
 
 
 
 
 
45
 
46
  ```
47
  project-root/
48
+ ├── app.py # FastAPI proxy backend
49
+ ├── requirements.txt # Python dependencies
50
+ ├── static/ # Static pages
51
+ │ └── index.html # Main HTML page
52
+ ├── public/ # Public resources
53
+ │ └── logo.png # App logo
54
+ ── frontend/ # Frontend code (for reference only)
55
+ ├── App.tsx # Main app container
56
+ ├── index.tsx # React entry point
57
+ ├── api/
58
+ │ └── apiClient.ts # API request encapsulation
59
+ ├── components/
60
+ │ ├── WorkflowSender.tsx # Workflow upload/send component
61
+ │ ├── RunStatusStepper.tsx # Execution progress visualization
62
+ │ ├── PingLabServer.tsx # Server status check
63
+ │ ├── HistoryPanel.tsx # History management
64
+ │ └── ErrorConsole.tsx # Error and log display
65
+ └── types/
66
+ └── types.ts # TypeScript type definitions
 
67
  ```
68
 
69
+ ## API Endpoints
70
+
71
+ - `GET /api/health`: Check if the lab server is online
72
+ - `POST /api/run_experiment`: Submit workflow execution request
73
+ - `GET /api/run_status/{run_id}`: Get workflow execution status
74
+ - `GET /api/sample_workflow`: Get a sample workflow (demo only)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
 
76
+ ## License
77
 
78
  MIT
create_space.py ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from huggingface_hub import create_repo, get_full_repo_name
2
+ import os
3
+ import sys
4
+
5
+ # 获取Space名称
6
+ if len(sys.argv) > 1:
7
+ space_name = sys.argv[1]
8
+ else:
9
+ space_name = input("Enter your Space name (e.g. hf-proxy-panel): ")
10
+
11
+ # 创建新的Space
12
+ try:
13
+ repo_id = create_repo(
14
+ space_name,
15
+ repo_type="space",
16
+ space_sdk="gradio", # 这里有几个选项:gradio, streamlit, docker, static
17
+ space_hardware="cpu-basic", # cpu-basic是免费的,其他选项包括cpu-upgrade, t4-small, a10g-small等
18
+ private=False
19
+ )
20
+ print(f"✓ Space created successfully: {repo_id}")
21
+
22
+ # 获取远程仓库URL
23
+ username = repo_id.split('/')[0]
24
+ full_repo_name = get_full_repo_name(space_name, token=None, organization=None)
25
+ git_url = f"https://huggingface.co/spaces/{full_repo_name}"
26
+
27
+ print(f"\nTo add the remote repository and push your code, run:")
28
+ print(f"git remote add origin https://huggingface.co/spaces/{full_repo_name}")
29
+ print(f"git push -u origin main")
30
+
31
+ print(f"\nYour Space will be available at: {git_url}")
32
+
33
+ except Exception as e:
34
+ print(f"✗ Error creating Space: {str(e)}")
35
+ sys.exit(1)