Spaces:
Runtime error
Runtime error
File size: 477 Bytes
9b3b8c8 291349f 9b3b8c8 291349f db31576 291349f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
import numpy as np
from typing import Union
import gradio as gr
def subtract(a: float, b: float) -> float:
"""Subtract b from a."""
try:
return float(a) - float(b)
except (ValueError, TypeError):
raise ValueError("Both inputs must be valid numbers")
subtract_interface = gr.Interface(
fn=subtract,
inputs=[gr.Number(label="A"), gr.Number(label="B")],
outputs="number",
title="Subtraction",
description="Subtract two numbers"
)
|