Spaces:
Running
Running
jadehardouin
commited on
Commit
•
8e75c4f
1
Parent(s):
564f119
Update models.py
Browse files
models.py
CHANGED
@@ -105,12 +105,13 @@ class OpenAIModel(BaseTCOModel):
|
|
105 |
label="($) Price/1K output prompt tokens",
|
106 |
interactive=False
|
107 |
)
|
108 |
-
self.info = gr.Markdown("The cost per input and output tokens values are from OpenAI's pricing web page
|
109 |
self.model.change(on_model_change, inputs=self.model, outputs=self.context_length).then(define_cost_per_token, inputs=[self.model, self.context_length], outputs=[self.input_tokens_cost_per_second, self.output_tokens_cost_per_second])
|
110 |
self.context_length.change(define_cost_per_token, inputs=[self.model, self.context_length], outputs=[self.input_tokens_cost_per_second, self.output_tokens_cost_per_second])
|
111 |
|
112 |
self.labor = gr.Number(0, visible=False,
|
113 |
label="($) Labor cost per month",
|
|
|
114 |
interactive=True
|
115 |
)
|
116 |
|
@@ -151,10 +152,11 @@ class OpenSourceLlama2Model(BaseTCOModel):
|
|
151 |
label="($) Price/1K output prompt tokens",
|
152 |
interactive=False
|
153 |
)
|
154 |
-
self.info = gr.Markdown("For the Llama2-70B model, we took the cost per input and output tokens values from
|
155 |
|
156 |
self.labor = gr.Number(10000, visible=False,
|
157 |
label="($) Labor cost per month",
|
|
|
158 |
interactive=True
|
159 |
)
|
160 |
|
@@ -195,6 +197,7 @@ class CohereModel(BaseTCOModel):
|
|
195 |
|
196 |
self.labor = gr.Number(0, visible=False,
|
197 |
label="($) Labor cost per month",
|
|
|
198 |
interactive=True
|
199 |
)
|
200 |
|
@@ -268,6 +271,6 @@ class ModelPage:
|
|
268 |
formula = model.get_formula()
|
269 |
latency = model.get_latency()
|
270 |
|
271 |
-
return f"Model {current_model} has a cost/request of: ${model_tco}", model_tco, formula, f"The average latency of this model is {latency}", labor_cost
|
272 |
|
273 |
begin = begin+model_n_args
|
|
|
105 |
label="($) Price/1K output prompt tokens",
|
106 |
interactive=False
|
107 |
)
|
108 |
+
self.info = gr.Markdown("The cost per input and output tokens values are from OpenAI's [pricing web page](https://openai.com/pricing)", interactive=False, visible=False)
|
109 |
self.model.change(on_model_change, inputs=self.model, outputs=self.context_length).then(define_cost_per_token, inputs=[self.model, self.context_length], outputs=[self.input_tokens_cost_per_second, self.output_tokens_cost_per_second])
|
110 |
self.context_length.change(define_cost_per_token, inputs=[self.model, self.context_length], outputs=[self.input_tokens_cost_per_second, self.output_tokens_cost_per_second])
|
111 |
|
112 |
self.labor = gr.Number(0, visible=False,
|
113 |
label="($) Labor cost per month",
|
114 |
+
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",
|
115 |
interactive=True
|
116 |
)
|
117 |
|
|
|
152 |
label="($) Price/1K output prompt tokens",
|
153 |
interactive=False
|
154 |
)
|
155 |
+
self.info = gr.Markdown("For the Llama2-70B model, we took the cost per input and output tokens values from [these benchmark results](https://www.cursor.so/blog/llama-inference#user-content-fn-llama-paper)", interactive=False, visible=False)
|
156 |
|
157 |
self.labor = gr.Number(10000, visible=False,
|
158 |
label="($) Labor cost per month",
|
159 |
+
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",
|
160 |
interactive=True
|
161 |
)
|
162 |
|
|
|
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",
|
201 |
interactive=True
|
202 |
)
|
203 |
|
|
|
271 |
formula = model.get_formula()
|
272 |
latency = model.get_latency()
|
273 |
|
274 |
+
return f"Model {current_model} has a cost/request of: ${model_tco:.5f}", model_tco, formula, f"The average latency of this model is {latency}", labor_cost
|
275 |
|
276 |
begin = begin+model_n_args
|