add ability to override default values from config (#58)

This commit is contained in:
Adil Hafeez 2024-09-17 22:37:58 -07:00 committed by GitHub
parent 9f3c845610
commit 3135ba8eae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 42 additions and 6 deletions

View file

@ -5,8 +5,9 @@ from openai import OpenAI
import gradio as gr
api_key = os.getenv("OPENAI_API_KEY")
CHAT_COMPLETION_ENDPOINT = os.getenv("CHAT_COMPLETION_ENDPOINT", "https://api.openai.com/v1")
client = OpenAI(api_key=api_key)
client = OpenAI(api_key=api_key, base_url=CHAT_COMPLETION_ENDPOINT)
def predict(message, history):
history_openai_format = []