Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
def openai_api_calculate_cost(usage,model=GPT_MODEL):
|
2 |
pricing = {
|
3 |
# 'gpt-3.5-turbo-4k': {
|
|
|
1 |
+
import os
|
2 |
+
import openai
|
3 |
+
import sys
|
4 |
+
|
5 |
+
import gradio as gr
|
6 |
+
|
7 |
+
import json
|
8 |
+
import requests
|
9 |
+
from tenacity import retry, wait_random_exponential, stop_after_attempt
|
10 |
+
# from termcolor import colored # doesn't actually work in Colab ¯\_(ツ)_/¯
|
11 |
+
|
12 |
+
GPT_MODEL = "gpt-3.5-turbo-1106"
|
13 |
+
|
14 |
def openai_api_calculate_cost(usage,model=GPT_MODEL):
|
15 |
pricing = {
|
16 |
# 'gpt-3.5-turbo-4k': {
|