Spaces:
Runtime error
Runtime error
File size: 483 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 multiply(a: float, b: float) -> float:
"""Multiply two numbers."""
try:
return float(a) * float(b)
except (ValueError, TypeError):
raise ValueError("Both inputs must be valid numbers")
multiply_interface = gr.Interface(
fn=multiply,
inputs=[gr.Number(label="A"), gr.Number(label="B")],
outputs="number",
title="Multiplication",
description="Multiply two numbers"
)
|