Spaces:
Running
Running
Remove tokencost
Browse files- app.py +6 -2
- model_prices.json +0 -0
- requirements.txt +1 -1
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
-
|
3 |
|
|
|
4 |
|
5 |
def compute_all(prompt_string, completion_string, model):
|
6 |
prompt_cost = calculate_prompt_cost(prompt_string, model)
|
@@ -13,9 +14,12 @@ def compute_all(prompt_string, completion_string, model):
|
|
13 |
|
14 |
|
15 |
with gr.Blocks(theme='soft') as demo:
|
|
|
|
|
|
|
16 |
with gr.Row():
|
17 |
with gr.Column():
|
18 |
-
prompt = gr.Textbox(value="
|
19 |
completion = gr.Textbox(value="...")
|
20 |
|
21 |
model = gr.Dropdown(value="gpt-3.5-turbo", choices=["gpt-3.5-turbo", "gpt-3.5-turbo"])
|
|
|
1 |
import gradio as gr
|
2 |
+
import pandas as pd
|
3 |
|
4 |
+
model_data = pd.read_json("model_prices.json")
|
5 |
|
6 |
def compute_all(prompt_string, completion_string, model):
|
7 |
prompt_cost = calculate_prompt_cost(prompt_string, model)
|
|
|
14 |
|
15 |
|
16 |
with gr.Blocks(theme='soft') as demo:
|
17 |
+
gr.Markdown("""### Text-to-$: calculate the price of your LLM runs
|
18 |
+
Based on data from the great [tokencost](https://github.com/AgentOps-AI/tokencost/blob/main/tokencost/model_prices.json).
|
19 |
+
""")
|
20 |
with gr.Row():
|
21 |
with gr.Column():
|
22 |
+
prompt = gr.Textbox(value="Lorem ipsum dolor sit amet...")
|
23 |
completion = gr.Textbox(value="...")
|
24 |
|
25 |
model = gr.Dropdown(value="gpt-3.5-turbo", choices=["gpt-3.5-turbo", "gpt-3.5-turbo"])
|
model_prices.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
requirements.txt
CHANGED
@@ -1 +1 @@
|
|
1 |
-
|
|
|
1 |
+
pandas
|