Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -17,6 +17,7 @@ theme=os.getenv("THEME")
|
|
17 |
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
|
18 |
# OpenAI model
|
19 |
openai_model = os.getenv("OPENAI_MODEL")
|
|
|
20 |
################# End OpenAI-SPECIFIC VALUES ######################
|
21 |
|
22 |
tx = os.getenv("TX")
|
@@ -25,7 +26,7 @@ file_name = os.getenv("FILE_NAME")
|
|
25 |
|
26 |
############### CHAT ###################
|
27 |
def predict(user_input, history):
|
28 |
-
max_length =
|
29 |
transcript_file_path = f"{prefix}{coach_code}-{file_name}"
|
30 |
transcript = "" # Initialize the transcript variable
|
31 |
|
@@ -53,7 +54,7 @@ def predict(user_input, history):
|
|
53 |
completion = client.chat.completions.create(
|
54 |
model=openai_model,
|
55 |
messages=history_openai_format,
|
56 |
-
temperature=
|
57 |
frequency_penalty=0.4,
|
58 |
presence_penalty=0.1,
|
59 |
stream=True
|
|
|
17 |
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
|
18 |
# OpenAI model
|
19 |
openai_model = os.getenv("OPENAI_MODEL")
|
20 |
+
temp = os.getenv("TEMPERATURE")
|
21 |
################# End OpenAI-SPECIFIC VALUES ######################
|
22 |
|
23 |
tx = os.getenv("TX")
|
|
|
26 |
|
27 |
############### CHAT ###################
|
28 |
def predict(user_input, history):
|
29 |
+
max_length = 3000
|
30 |
transcript_file_path = f"{prefix}{coach_code}-{file_name}"
|
31 |
transcript = "" # Initialize the transcript variable
|
32 |
|
|
|
54 |
completion = client.chat.completions.create(
|
55 |
model=openai_model,
|
56 |
messages=history_openai_format,
|
57 |
+
temperature=temp,
|
58 |
frequency_penalty=0.4,
|
59 |
presence_penalty=0.1,
|
60 |
stream=True
|