jadehardouin commited on
Commit
76168c9
1 Parent(s): 2dd2bac

Update models.py

Browse files
Files changed (1) hide show
  1. models.py +9 -5
models.py CHANGED
@@ -55,7 +55,8 @@ class OpenAIModel(BaseTCOModel):
55
 
56
  def __init__(self):
57
  self.set_name("(SaaS) OpenAI")
58
- self.set_formula(r"""$CR = \frac{CIT\_1K \times IT + COT\_1K \times OT}{1000}$ <br>
 
59
  with: <br>
60
  CR = Cost per Request <br>
61
  CIT_1K = Cost per 1000 Input Tokens <br>
@@ -125,7 +126,8 @@ class OpenSourceLlama2Model(BaseTCOModel):
125
 
126
  def __init__(self):
127
  self.set_name("(Open source) Llama 2 70B")
128
- self.set_formula(r"""$CR = \frac{CIT\_1K \times IT + COT\_1K \times OT}{1000}$ <br>
 
129
  with: <br>
130
  CR = Cost per Request <br>
131
  CIT_1K = Cost per 1000 Input Tokens <br>
@@ -174,10 +176,11 @@ class CohereModel(BaseTCOModel):
174
 
175
  def __init__(self):
176
  self.set_name("(SaaS) Cohere")
177
- self.set_formula(r"""$CR = \frac{CT\_1M \times (IT + OT)}{1000000}$ <br>
 
178
  with: <br>
179
  CR = Cost per Request <br>
180
- CT_1M = Cost per one million Tokens (from Cohere's pricing web page) <br>
181
  IT = Input Tokens <br>
182
  OT = Output Tokens
183
  """)
@@ -194,7 +197,8 @@ class CohereModel(BaseTCOModel):
194
  self.model: gr.Dropdown.update(choices=["Default", "Custom"])
195
  else:
196
  self.model: gr.Dropdown.update(choices=["Default", "Custom"])
197
-
 
198
  self.labor = gr.Number(0, visible=False,
199
  label="($) Labor cost per month",
200
  info="This is how much it will cost you to have an engineer specialized in Machine Learning take care of the deployment of your model service",
 
55
 
56
  def __init__(self):
57
  self.set_name("(SaaS) OpenAI")
58
+ self.set_formula(r"""For the (SaaS) OpenAI service: <br>
59
+ $CR = \frac{CIT\_1K \times IT + COT\_1K \times OT}{1000}$ <br>
60
  with: <br>
61
  CR = Cost per Request <br>
62
  CIT_1K = Cost per 1000 Input Tokens <br>
 
126
 
127
  def __init__(self):
128
  self.set_name("(Open source) Llama 2 70B")
129
+ self.set_formula(r"""For the (Open source) Llama 2 70B service: <br>
130
+ $CR = \frac{CIT\_1K \times IT + COT\_1K \times OT}{1000}$ <br>
131
  with: <br>
132
  CR = Cost per Request <br>
133
  CIT_1K = Cost per 1000 Input Tokens <br>
 
176
 
177
  def __init__(self):
178
  self.set_name("(SaaS) Cohere")
179
+ self.set_formula(r"""For the (SaaS) Cohere service: <br>
180
+ $CR = \frac{CT\_1M \times (IT + OT)}{1000000}$ <br>
181
  with: <br>
182
  CR = Cost per Request <br>
183
+ CT_1M = Cost per one million Tokens <br>
184
  IT = Input Tokens <br>
185
  OT = Output Tokens
186
  """)
 
197
  self.model: gr.Dropdown.update(choices=["Default", "Custom"])
198
  else:
199
  self.model: gr.Dropdown.update(choices=["Default", "Custom"])
200
+ self.info = gr.Markdown("The cost per input and output tokens value is from Cohere's [pricing web page](https://cohere.com/pricing?utm_term=&utm_campaign=Cohere+Brand+%26+Industry+Terms&utm_source=adwords&utm_medium=ppc&hsa_acc=4946693046&hsa_cam=20368816223&hsa_grp=154209120409&hsa_ad=666081801359&hsa_src=g&hsa_tgt=dsa-19959388920&hsa_kw=&hsa_mt=&hsa_net=adwords&hsa_ver=3&gad=1&gclid=CjwKCAjww7KmBhAyEiwA5-PUSlyO7pq0zxeVrhViXMd8WuILW6uY-cfP1-SVuUfs-leUAz14xHlOHxoCmfkQAvD_BwE)", interactive=False, visible=False)
201
+
202
  self.labor = gr.Number(0, visible=False,
203
  label="($) Labor cost per month",
204
  info="This is how much it will cost you to have an engineer specialized in Machine Learning take care of the deployment of your model service",