jadehardouin commited on
Commit
9c1a1da
1 Parent(s): ead5edf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -11,13 +11,13 @@ description=f"""
11
  <p>Please note that we focus on getting the service up and running, but not the maintenance that follows.</p>
12
  """
13
  formula = r"""
14
- $CR = \frac{CIT\_1K \times IT + COT\_1K \times OT}{1000}$ <br>
15
  with: <br>
16
- CR = Cost per Request <br>
17
- CIT_1K = Cost per 1000 Input Tokens <br>
18
- COT_1K = Cost per 1000 Output Tokens <br>
19
- IT = Input Tokens <br>
20
- OT = Output Tokens
21
  """
22
 
23
  def on_use_case_change(use_case):
@@ -51,7 +51,7 @@ def compare_info(tco1, tco2, dropdown, dropdown2):
51
  plt.tight_layout()
52
  plt.savefig('cost_comparison.png') # Save to a file
53
 
54
- return gr.update(value='cost_comparison.png'), comparison_result
55
 
56
  def create_table(tco1, tco2, labor_cost1, labor_cost2, dropdown, dropdown2, latency, latency2):
57
  list_values = []
@@ -144,7 +144,7 @@ with gr.Blocks(theme=style) as demo:
144
  info = gr.Markdown(text2)
145
  with gr.Row():
146
  with gr.Column(scale=1):
147
- image = gr.Image()
148
  ratio = gr.Markdown()
149
  with gr.Column(scale=2):
150
  plot = gr.LinePlot(visible=False)
 
11
  <p>Please note that we focus on getting the service up and running, but not the maintenance that follows.</p>
12
  """
13
  formula = r"""
14
+ $CR = \frac{CIT_{1K} \times IT + COT_{1K} \times OT}{1000}$ <br>
15
  with: <br>
16
+ $CR$ = Cost per Request <br>
17
+ $CIT_{1K}$ = Cost per 1000 Input Tokens <br>
18
+ $COT_{1K}$ = Cost per 1000 Output Tokens <br>
19
+ $IT$ = Input Tokens <br>
20
+ $OT$ = Output Tokens
21
  """
22
 
23
  def on_use_case_change(use_case):
 
51
  plt.tight_layout()
52
  plt.savefig('cost_comparison.png') # Save to a file
53
 
54
+ return gr.update(value='cost_comparison.png', visible=True), comparison_result
55
 
56
  def create_table(tco1, tco2, labor_cost1, labor_cost2, dropdown, dropdown2, latency, latency2):
57
  list_values = []
 
144
  info = gr.Markdown(text2)
145
  with gr.Row():
146
  with gr.Column(scale=1):
147
+ image = gr.Image(visible=False)
148
  ratio = gr.Markdown()
149
  with gr.Column(scale=2):
150
  plot = gr.LinePlot(visible=False)