Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,12 +5,11 @@ import os.path
|
|
| 5 |
from datetime import datetime
|
| 6 |
|
| 7 |
################# Start PERSONA-SPECIFIC VALUES ######################
|
| 8 |
-
coach_code = "
|
| 9 |
-
coach_name_short = "
|
| 10 |
-
coach_name_upper = "
|
| 11 |
-
coach_name_long = "General George S. Patton"
|
| 12 |
sys_prompt_new = os.getenv("PROMPT_NEW")
|
| 13 |
-
theme="
|
| 14 |
################# End PERSONA-SPECIFIC VALUES ######################
|
| 15 |
|
| 16 |
################# Start OpenAI-SPECIFIC VALUES ######################
|
|
@@ -21,7 +20,7 @@ openai_model = "gpt-3.5-turbo-0125"
|
|
| 21 |
################# End OpenAI-SPECIFIC VALUES ######################
|
| 22 |
|
| 23 |
tx = os.getenv("TX")
|
| 24 |
-
prefix = "" # "data/" if local or
|
| 25 |
|
| 26 |
############### CHAT ###################
|
| 27 |
def predict(user_input, history):
|
|
@@ -37,7 +36,7 @@ def predict(user_input, history):
|
|
| 37 |
transcript = file.read()
|
| 38 |
return transcript
|
| 39 |
except FileNotFoundError:
|
| 40 |
-
return "File
|
| 41 |
elif len(user_input) > max_length:
|
| 42 |
raise gr.Error(f"Input is TOO LONG. Max length is {max_length} characters. Try again.")
|
| 43 |
|
|
|
|
| 5 |
from datetime import datetime
|
| 6 |
|
| 7 |
################# Start PERSONA-SPECIFIC VALUES ######################
|
| 8 |
+
coach_code = os.getenv("COACH_CODE")
|
| 9 |
+
coach_name_short = os.getenv("COACH_NAME_SHORT")
|
| 10 |
+
coach_name_upper = os.getenv("COACH_NAME_UPPER")
|
|
|
|
| 11 |
sys_prompt_new = os.getenv("PROMPT_NEW")
|
| 12 |
+
theme=""
|
| 13 |
################# End PERSONA-SPECIFIC VALUES ######################
|
| 14 |
|
| 15 |
################# Start OpenAI-SPECIFIC VALUES ######################
|
|
|
|
| 20 |
################# End OpenAI-SPECIFIC VALUES ######################
|
| 21 |
|
| 22 |
tx = os.getenv("TX")
|
| 23 |
+
prefix = "" # "data/" if local or "/data/" if persistent in HF
|
| 24 |
|
| 25 |
############### CHAT ###################
|
| 26 |
def predict(user_input, history):
|
|
|
|
| 36 |
transcript = file.read()
|
| 37 |
return transcript
|
| 38 |
except FileNotFoundError:
|
| 39 |
+
return "File 'transcript.txt' not found."
|
| 40 |
elif len(user_input) > max_length:
|
| 41 |
raise gr.Error(f"Input is TOO LONG. Max length is {max_length} characters. Try again.")
|
| 42 |
|