Maia Pelletier commited on
Commit ·
dce9c5d
1
Parent(s): 54f1b53
change to Zephyr
Browse files
app.py
CHANGED
|
@@ -91,11 +91,11 @@ class RAGChatbot:
|
|
| 91 |
"""Chatbot with RAG capabilities."""
|
| 92 |
|
| 93 |
# Default and fallback models (try in order until one is supported by your Inference API providers)
|
| 94 |
-
DEFAULT_CHAT_MODEL = "
|
| 95 |
FALLBACK_CHAT_MODELS = [
|
| 96 |
-
"
|
| 97 |
-
"
|
| 98 |
-
"
|
| 99 |
]
|
| 100 |
|
| 101 |
def __init__(
|
|
@@ -177,7 +177,12 @@ class RAGChatbot:
|
|
| 177 |
except Exception as e:
|
| 178 |
last_error = e
|
| 179 |
err_str = str(e).lower()
|
| 180 |
-
if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
print(f"[DEBUG] Model {model} not available, trying next fallback.")
|
| 182 |
continue
|
| 183 |
print(f"[DEBUG] _generate_with_chat exception for {model}: {type(e).__name__}: {e}")
|
|
|
|
| 91 |
"""Chatbot with RAG capabilities."""
|
| 92 |
|
| 93 |
# Default and fallback models (try in order until one is supported by your Inference API providers)
|
| 94 |
+
DEFAULT_CHAT_MODEL = "HuggingFaceH4/zephyr-7b-beta"
|
| 95 |
FALLBACK_CHAT_MODELS = [
|
| 96 |
+
"mistralai/Mixtral-8x7B-Instruct-v0.1",
|
| 97 |
+
"meta-llama/Llama-3.2-3B-Instruct",
|
| 98 |
+
"Qwen/Qwen2.5-7B-Instruct",
|
| 99 |
]
|
| 100 |
|
| 101 |
def __init__(
|
|
|
|
| 177 |
except Exception as e:
|
| 178 |
last_error = e
|
| 179 |
err_str = str(e).lower()
|
| 180 |
+
if (
|
| 181 |
+
"model_not_supported" in err_str
|
| 182 |
+
or "not supported by any provider" in err_str
|
| 183 |
+
or "410" in err_str
|
| 184 |
+
or "gone" in err_str
|
| 185 |
+
):
|
| 186 |
print(f"[DEBUG] Model {model} not available, trying next fallback.")
|
| 187 |
continue
|
| 188 |
print(f"[DEBUG] _generate_with_chat exception for {model}: {type(e).__name__}: {e}")
|