File size: 786 Bytes
069fbff
 
 
 
ee455e6
069fbff
84a6a31
069fbff
 
4b498c2
 
069fbff
ee455e6
8661032
069fbff
ee455e6
069fbff
ee455e6
069fbff
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import gradio as gr
from modules.dollar_cost_averaging import dollar_cost_averaging

examples = [
    [200, 90, 100, 200]
]

# Define the inputs
first_purchase = gr.Markdown("<h3 class='h3_title'>FIRST PURCHASE</h3>")
old_price = gr.Number(label="Old Price", value=18153)
old_quantity = gr.Number(label="Quantity", value=122)
second_purchase = gr.Markdown("<h3 class='h3_title'>SECOND PURCHASE</h3>")
new_price = gr.Textbox(label="New Price", value="15000")
new_quantity = gr.Slider(label="Quantity", value=1)

input = [old_price, old_quantity, new_price, new_quantity]
output = gr.HTML()
component_rows = [first_purchase, old_price, old_quantity, second_purchase, new_price, new_quantity]

# Define the update function
def update_output(*args):
    return dollar_cost_averaging(*args)