Spaces:
Running
Running
minor updates
Browse files
app.py
CHANGED
@@ -21,6 +21,10 @@ def get_cost(system_prompt, user_prompt, assistant_response, model):
|
|
21 |
encoding = tiktoken.get_encoding("cl100k_base") # same encoding for both models
|
22 |
|
23 |
# default prices
|
|
|
|
|
|
|
|
|
24 |
if model == "gpt-3.5-turbo":
|
25 |
input_price = 0.5
|
26 |
output_price = 1.5
|
@@ -48,7 +52,7 @@ demo = gr.Interface(
|
|
48 |
gr.Dropdown(
|
49 |
choices=["gpt-4-turbo", "gpt-3.5-turbo"],
|
50 |
label="Model",
|
51 |
-
value=
|
52 |
info="Pricing: GPT 3.5 Turbo: input $0.5 / 1M tokens, output $1.5 / 1M tokens | GPT 4 turbo: input $10 / 1M tokens, output $30 / 1M tokens"
|
53 |
),
|
54 |
],
|
@@ -165,4 +169,4 @@ demo = gr.Interface(
|
|
165 |
]
|
166 |
)
|
167 |
|
168 |
-
demo.launch()
|
|
|
21 |
encoding = tiktoken.get_encoding("cl100k_base") # same encoding for both models
|
22 |
|
23 |
# default prices
|
24 |
+
if model == "gpt-4-turbo":
|
25 |
+
model = "gpt-4"
|
26 |
+
|
27 |
+
#print(model)
|
28 |
if model == "gpt-3.5-turbo":
|
29 |
input_price = 0.5
|
30 |
output_price = 1.5
|
|
|
52 |
gr.Dropdown(
|
53 |
choices=["gpt-4-turbo", "gpt-3.5-turbo"],
|
54 |
label="Model",
|
55 |
+
value="gpt-4-turbo",
|
56 |
info="Pricing: GPT 3.5 Turbo: input $0.5 / 1M tokens, output $1.5 / 1M tokens | GPT 4 turbo: input $10 / 1M tokens, output $30 / 1M tokens"
|
57 |
),
|
58 |
],
|
|
|
169 |
]
|
170 |
)
|
171 |
|
172 |
+
demo.launch(share=True)
|