This commit is contained in:
parent
a200a614da
commit
b4f9d4ddd0
|
|
@ -15,6 +15,7 @@ WORKDIR /app
|
||||||
|
|
||||||
# 拷贝源码(包含 requirements 子目录)
|
# 拷贝源码(包含 requirements 子目录)
|
||||||
COPY evalscope.0.17.0/ ./evalscope
|
COPY evalscope.0.17.0/ ./evalscope
|
||||||
|
COPY gradio_ui.py .
|
||||||
|
|
||||||
# 升级 pip 工具
|
# 升级 pip 工具
|
||||||
RUN pip install --upgrade pip setuptools wheel
|
RUN pip install --upgrade pip setuptools wheel
|
||||||
|
|
@ -32,5 +33,5 @@ RUN pip install \
|
||||||
-r ./evalscope/requirements/rag.txt && \
|
-r ./evalscope/requirements/rag.txt && \
|
||||||
pip install -e ./evalscope
|
pip install -e ./evalscope
|
||||||
|
|
||||||
# 启动后输出 evalscope 总 help
|
# 启动 Gradio 服务
|
||||||
ENTRYPOINT ["evalscope", "--help"]
|
CMD ["python3", "gradio_ui.py"]
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
import gradio as gr
|
||||||
|
|
||||||
|
def run_eval(inputs, native, other, outputs):
|
||||||
|
# 模拟输出,实际应拼接指令后调用 subprocess.run 或远程 API
|
||||||
|
result = (
|
||||||
|
f"\n[Eval Started]\n"
|
||||||
|
f"Inputs: {inputs}\n"
|
||||||
|
f"Native Modules: {native}\n"
|
||||||
|
f"Other Backends: {other}\n"
|
||||||
|
f"Outputs: {outputs}\n"
|
||||||
|
f"[Eval Finished]"
|
||||||
|
)
|
||||||
|
return result
|
||||||
|
|
||||||
|
with gr.Blocks(title="EvalScope 全功能界面") as demo:
|
||||||
|
gr.Markdown("## EvalScope 功能选择平台")
|
||||||
|
|
||||||
|
with gr.Row():
|
||||||
|
with gr.Column():
|
||||||
|
gr.Markdown("### INPUT 输入区")
|
||||||
|
input_choices = gr.CheckboxGroup(
|
||||||
|
label="选择输入源",
|
||||||
|
choices=["API Models", "Local Models", "Benchmarks", "Custom Datasets"]
|
||||||
|
)
|
||||||
|
|
||||||
|
with gr.Row():
|
||||||
|
with gr.Column():
|
||||||
|
gr.Markdown("### NATIVE 本地功能区")
|
||||||
|
native_choices = gr.CheckboxGroup(
|
||||||
|
label="启用本地模块",
|
||||||
|
choices=["Model Adapter", "Data Adapter", "Evaluator", "Perf Monitor"]
|
||||||
|
)
|
||||||
|
|
||||||
|
with gr.Column():
|
||||||
|
gr.Markdown("### OTHER 其他功能区")
|
||||||
|
other_choices = gr.CheckboxGroup(
|
||||||
|
label="启用外部后端",
|
||||||
|
choices=["OpenCompass", "VLMEvalKit", "RAGAS", "MTEB/CMTEB"]
|
||||||
|
)
|
||||||
|
|
||||||
|
with gr.Row():
|
||||||
|
with gr.Column():
|
||||||
|
gr.Markdown("### OUTPUT 输出区")
|
||||||
|
output_choices = gr.CheckboxGroup(
|
||||||
|
label="输出形式",
|
||||||
|
choices=["Evaluation Report", "Gradio", "WandB", "Swanlab"]
|
||||||
|
)
|
||||||
|
|
||||||
|
run_button = gr.Button("Run Evaluation")
|
||||||
|
output_text = gr.Textbox(label="执行结果", lines=10)
|
||||||
|
|
||||||
|
run_button.click(run_eval, inputs=[input_choices, native_choices, other_choices, output_choices], outputs=output_text)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
demo.launch(server_name="0.0.0.0", server_port=7900)
|
||||||
Loading…
Reference in New Issue