Spaces:
Running
Running
jadehardouin
commited on
Commit
•
2e06873
1
Parent(s):
01f5691
Update app.py
Browse files
app.py
CHANGED
@@ -77,18 +77,11 @@ def create_table(tco1, tco2, labor_cost1, labor_cost2, dropdown, dropdown2, late
|
|
77 |
def compute_cost_per_request(*args):
|
78 |
dropdown_id = args[-2]
|
79 |
dropdown_id2 = args[-1]
|
80 |
-
print("Dropdown 1 value:", dropdown_id)
|
81 |
-
print("Dropdown 2 value:", dropdown_id2)
|
82 |
if dropdown_id!="" and dropdown_id2!="":
|
83 |
-
# Separate the arguments for page1 and page2
|
84 |
args_page1 = list(args) + [dropdown_id, input_tokens, output_tokens]
|
85 |
args_page2 = list(args) + [dropdown_id2, input_tokens, output_tokens]
|
86 |
-
print("Args for Page 1:", args_page1)
|
87 |
-
print("Args for Page 2:", args_page2)
|
88 |
-
# Compute and compare using both pages
|
89 |
result_page1 = page1.compute_cost_per_token(*args_page1)
|
90 |
result_page2 = page2.compute_cost_per_token(*args_page2)
|
91 |
-
# Unpack the results from the functions
|
92 |
tco1, latency, labor_cost1 = result_page1
|
93 |
tco2, latency2, labor_cost2 = result_page2
|
94 |
return tco1, latency, labor_cost1, tco2, latency2, labor_cost2
|
|
|
77 |
def compute_cost_per_request(*args):
|
78 |
dropdown_id = args[-2]
|
79 |
dropdown_id2 = args[-1]
|
|
|
|
|
80 |
if dropdown_id!="" and dropdown_id2!="":
|
|
|
81 |
args_page1 = list(args) + [dropdown_id, input_tokens, output_tokens]
|
82 |
args_page2 = list(args) + [dropdown_id2, input_tokens, output_tokens]
|
|
|
|
|
|
|
83 |
result_page1 = page1.compute_cost_per_token(*args_page1)
|
84 |
result_page2 = page2.compute_cost_per_token(*args_page2)
|
|
|
85 |
tco1, latency, labor_cost1 = result_page1
|
86 |
tco2, latency2, labor_cost2 = result_page2
|
87 |
return tco1, latency, labor_cost1, tco2, latency2, labor_cost2
|