Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -32,6 +32,21 @@ def compute_roi(avg_duration, estd_courses, course_price, price_dubbing, course_
|
|
| 32 |
"""
|
| 33 |
return gr.update(value=new_markdown, visible=True)
|
| 34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
with gr.Blocks(theme="gradio/monochrome") as demo:
|
| 36 |
gr.Markdown("# Dubbing Course ROI Calculator")
|
| 37 |
with gr.Row():
|
|
@@ -47,11 +62,20 @@ with gr.Blocks(theme="gradio/monochrome") as demo:
|
|
| 47 |
with gr.Row():
|
| 48 |
estd_courses_num = gr.Number(label="Estimated Dubbed Courses Sold", info="Assuming one person buys one course.")
|
| 49 |
price_dubbing_txt = gr.Textbox(label="Dubpro's Per Minute Price", info="This price is inclusive of GST.")
|
| 50 |
-
|
| 51 |
calc_roi = gr.Button("Calculate ROI")
|
| 52 |
-
|
| 53 |
output = gr.Markdown()
|
| 54 |
-
|
| 55 |
calc_roi.click(compute_roi, [avg_duration_num, estd_courses_num, course_price_txt, price_dubbing_txt, course_name_txt], output)
|
| 56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
demo.launch()
|
|
|
|
| 32 |
"""
|
| 33 |
return gr.update(value=new_markdown, visible=True)
|
| 34 |
|
| 35 |
+
|
| 36 |
+
def calcualte_cost_capacity(content_hours, pricing_per_minute, expected_delivery_days, avg_translator_speed, translators_pay_per_month):
|
| 37 |
+
sleep(1)
|
| 38 |
+
total_revenue = float(content_hours) * float(pricing_per_minute)
|
| 39 |
+
expected_num_people = int(float(content_hours) * 60 / (float(avg_translator_speed) * float(expected_delivery_days)))
|
| 40 |
+
company_cost_beared = expected_num_people * float(expected_delivery_days) * float(translators_pay_per_month)
|
| 41 |
+
|
| 42 |
+
res_markdown = f"""## Cost Capacity
|
| 43 |
+
## _Total Revenue Generated : ₹{indian_notation(int(total_revenue))}
|
| 44 |
+
## _Expected Number of Translators required : {expected_num_people}
|
| 45 |
+
## _Cost beared for Translators : ₹{indian_notation(int(company_cost_beared))}
|
| 46 |
+
"""
|
| 47 |
+
return gr.update(value=res_markdown, visible=True)
|
| 48 |
+
|
| 49 |
+
|
| 50 |
with gr.Blocks(theme="gradio/monochrome") as demo:
|
| 51 |
gr.Markdown("# Dubbing Course ROI Calculator")
|
| 52 |
with gr.Row():
|
|
|
|
| 62 |
with gr.Row():
|
| 63 |
estd_courses_num = gr.Number(label="Estimated Dubbed Courses Sold", info="Assuming one person buys one course.")
|
| 64 |
price_dubbing_txt = gr.Textbox(label="Dubpro's Per Minute Price", info="This price is inclusive of GST.")
|
|
|
|
| 65 |
calc_roi = gr.Button("Calculate ROI")
|
|
|
|
| 66 |
output = gr.Markdown()
|
|
|
|
| 67 |
calc_roi.click(compute_roi, [avg_duration_num, estd_courses_num, course_price_txt, price_dubbing_txt, course_name_txt], output)
|
| 68 |
|
| 69 |
+
gr.Markdown("# Course Cost Capacity")
|
| 70 |
+
with gr.Row():
|
| 71 |
+
content_hours_num = gr.Number(label="Hours of Content")
|
| 72 |
+
pricing_per_minute_num = gr.Number(label="Price of Course Per Minute of Dubbing (in Rs)")
|
| 73 |
+
expected_delivery_days_num = gr.Number(label="Expected Number of Days for Delivery")
|
| 74 |
+
with gr.Row():
|
| 75 |
+
avg_translator_speed_num = gr.Number(label="Speed of Average Translator Per Day (in minutes)")
|
| 76 |
+
translators_pay_per_month_num = gr.Number(label="Average Cost of Translator per Month (in Rs)")
|
| 77 |
+
calcualte_cost_capacity_btn = gr.Button("Calculate Cost Capacity")
|
| 78 |
+
output_2 = gr.Markdown()
|
| 79 |
+
calcualte_cost_capacity_btn.click(calcualte_cost_capacity, [content_hours_num, pricing_per_minute_num, expected_delivery_days_num, avg_translator_speed_num, translators_pay_per_month_num], output_2)
|
| 80 |
+
|
| 81 |
demo.launch()
|