Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from gradio import Interface
|
| 3 |
+
|
| 4 |
+
# Define the addition function
|
| 5 |
+
def add(a, b):
|
| 6 |
+
return a + b
|
| 7 |
+
|
| 8 |
+
# Create the user interface using Gradio and Streamlit
|
| 9 |
+
add_ui = Interface(fn=add, inputs="number", outputs="text")
|
| 10 |
+
st.title("Streamlit & Gradio Addition Calculator")
|
| 11 |
+
add_block = add_ui.launch()
|
| 12 |
+
st.markdown(f'**Input:** {add_block.inputs}')
|
| 13 |
+
st.markdown(f'**Output:** {add_block.outputs[0]}')
|