Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -35,12 +35,20 @@ def codette_chat(message, history, consent=True, dynamic_rec=True, use_finetune=
|
|
35 |
)
|
36 |
return response['choices'][0]['message']['content']
|
37 |
except Exception as e:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
fallback = codette_cqure.recursive_universal_reasoning(
|
39 |
message,
|
40 |
user_consent=consent,
|
41 |
dynamic_recursion=dynamic_rec
|
42 |
)
|
43 |
-
return f"
|
44 |
else:
|
45 |
return codette_cqure.recursive_universal_reasoning(
|
46 |
message,
|
|
|
35 |
)
|
36 |
return response['choices'][0]['message']['content']
|
37 |
except Exception as e:
|
38 |
+
err_msg = str(e)
|
39 |
+
if "Response ended prematurely" in err_msg:
|
40 |
+
err_note = "[FT model network timeout. Using local core to continue the conversation.]"
|
41 |
+
internal_flag = "â ï¸ Potential proxy interference or timeout from OpenAI stream detected."
|
42 |
+
else:
|
43 |
+
err_note = f"[Error calling FT model]: {err_msg}"
|
44 |
+
internal_flag = "â ï¸ Unknown FT error occurred."
|
45 |
+
|
46 |
fallback = codette_cqure.recursive_universal_reasoning(
|
47 |
message,
|
48 |
user_consent=consent,
|
49 |
dynamic_recursion=dynamic_rec
|
50 |
)
|
51 |
+
return f"{err_note}\n{internal_flag}\n\nCodette's fallback:\n{fallback}"
|
52 |
else:
|
53 |
return codette_cqure.recursive_universal_reasoning(
|
54 |
message,
|