Update app.py
Browse files
app.py
CHANGED
|
@@ -20,20 +20,6 @@ chatter_owl_url = "file/images/chatter_owl.png"
|
|
| 20 |
model = WhisperModel("base", compute_type="int8") # Fastest CPU option
|
| 21 |
openai.api_key = os.getenv("OPENAI_API_KEY")
|
| 22 |
|
| 23 |
-
# Optional safety check
|
| 24 |
-
TMP_DIR = "/tmp"
|
| 25 |
-
|
| 26 |
-
# Clean up /tmp folder at runtime start
|
| 27 |
-
for sub in os.listdir(TMP_DIR):
|
| 28 |
-
sub_path = os.path.join(TMP_DIR, sub)
|
| 29 |
-
try:
|
| 30 |
-
if os.path.isfile(sub_path) or os.path.islink(sub_path):
|
| 31 |
-
os.unlink(sub_path)
|
| 32 |
-
elif os.path.isdir(sub_path):
|
| 33 |
-
shutil.rmtree(sub_path)
|
| 34 |
-
except Exception as e:
|
| 35 |
-
print(f"Failed to delete {sub_path}. Reason: {e}")
|
| 36 |
-
|
| 37 |
# Prompt template
|
| 38 |
PROMPT_TEMPLATE = """
|
| 39 |
You are a communication coach evaluating a user's spoken response.
|
|
@@ -182,4 +168,4 @@ with gr.Blocks(css="light_mode_chatter_owl.css") as app:
|
|
| 182 |
|
| 183 |
if __name__ == "__main__":
|
| 184 |
print("✅ App is launching...")
|
| 185 |
-
|
|
|
|
| 20 |
model = WhisperModel("base", compute_type="int8") # Fastest CPU option
|
| 21 |
openai.api_key = os.getenv("OPENAI_API_KEY")
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
# Prompt template
|
| 24 |
PROMPT_TEMPLATE = """
|
| 25 |
You are a communication coach evaluating a user's spoken response.
|
|
|
|
| 168 |
|
| 169 |
if __name__ == "__main__":
|
| 170 |
print("✅ App is launching...")
|
| 171 |
+
app.launch(server_name="0.0.0.0", server_port=7860, debug=True)
|