peft-bench-eval / app.py
Mdrnfox's picture
Create app.py
c3483b0 verified
raw
history blame
685 Bytes
import gradio as gr
import spaces
import subprocess
import requests
import datetime
@spaces.GPU
def run_peft_eval():
subprocess.run(["python3", "run_eval.py"], check=True)
print("Evaluation complete.")
try:
requests.post(os.environ["HF_ENDPOINT_SHUTDOWN"]) # Shutdown space after run
except Exception as e:
print("Failed to shutdown:", e)
return f"PEFT-Bench completed at {datetime.datetime.utcnow():%Y-%m-%d %H:%M UTC}"
with gr.Blocks() as demo:
gr.Markdown("### Running PEFT-Bench Evaluation...\nThis Space will shut down when done.")
output = gr.Textbox(label="Status")
demo.load(fn=run_peft_eval, outputs=output)
demo.launch()