Gregor Betz
commited on
config bugfix
Browse files- app.py +8 -8
- backend/config.py +1 -1
app.py
CHANGED
|
@@ -93,6 +93,10 @@ CHATBOT_INSTRUCTIONS = (
|
|
| 93 |
"Please use the 👋 Community tab above to reach out.\n"
|
| 94 |
)
|
| 95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
def new_conversation_id():
|
| 98 |
conversation_id = str(uuid.uuid4())
|
|
@@ -127,8 +131,8 @@ def add_message(history, message, conversation_id):
|
|
| 127 |
|
| 128 |
async def bot(
|
| 129 |
history,
|
| 130 |
-
client_kwargs,
|
| 131 |
-
guide_kwargs,
|
| 132 |
conversation_id,
|
| 133 |
progress=gr.Progress(),
|
| 134 |
):
|
|
@@ -203,10 +207,6 @@ with gr.Blocks() as demo:
|
|
| 203 |
conversation_id = gr.State(str(uuid.uuid4()))
|
| 204 |
tos_approved = gr.State(False)
|
| 205 |
|
| 206 |
-
client_kwargs, guide_kwargs = process_config(DEMO_CONFIG)
|
| 207 |
-
logging.info(f"Reasoning guide expert model is {guide_kwargs['expert_model']}.")
|
| 208 |
-
|
| 209 |
-
|
| 210 |
with gr.Tab(label="Chatbot", visible=False) as chatbot_tab:
|
| 211 |
|
| 212 |
# chatbot
|
|
@@ -226,8 +226,8 @@ with gr.Blocks() as demo:
|
|
| 226 |
bot,
|
| 227 |
[
|
| 228 |
chatbot,
|
| 229 |
-
client_kwargs,
|
| 230 |
-
guide_kwargs,
|
| 231 |
conversation_id
|
| 232 |
],
|
| 233 |
chatbot,
|
|
|
|
| 93 |
"Please use the 👋 Community tab above to reach out.\n"
|
| 94 |
)
|
| 95 |
|
| 96 |
+
# config
|
| 97 |
+
client_kwargs, guide_kwargs = process_config(DEMO_CONFIG)
|
| 98 |
+
logging.info(f"Reasoning guide expert model is {guide_kwargs['expert_model']}.")
|
| 99 |
+
|
| 100 |
|
| 101 |
def new_conversation_id():
|
| 102 |
conversation_id = str(uuid.uuid4())
|
|
|
|
| 131 |
|
| 132 |
async def bot(
|
| 133 |
history,
|
| 134 |
+
#client_kwargs,
|
| 135 |
+
#guide_kwargs,
|
| 136 |
conversation_id,
|
| 137 |
progress=gr.Progress(),
|
| 138 |
):
|
|
|
|
| 207 |
conversation_id = gr.State(str(uuid.uuid4()))
|
| 208 |
tos_approved = gr.State(False)
|
| 209 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 210 |
with gr.Tab(label="Chatbot", visible=False) as chatbot_tab:
|
| 211 |
|
| 212 |
# chatbot
|
|
|
|
| 226 |
bot,
|
| 227 |
[
|
| 228 |
chatbot,
|
| 229 |
+
#client_kwargs,
|
| 230 |
+
#guide_kwargs,
|
| 231 |
conversation_id
|
| 232 |
],
|
| 233 |
chatbot,
|
backend/config.py
CHANGED
|
@@ -42,7 +42,7 @@ def process_config(config):
|
|
| 42 |
else:
|
| 43 |
raise ValueError("config.yaml is missing client_llm settings.")
|
| 44 |
|
| 45 |
-
guide_kwargs = {}
|
| 46 |
if "expert_llm" in config:
|
| 47 |
if "model_id" in config["expert_llm"]:
|
| 48 |
guide_kwargs["expert_model"] = config["expert_llm"]["model_id"]
|
|
|
|
| 42 |
else:
|
| 43 |
raise ValueError("config.yaml is missing client_llm settings.")
|
| 44 |
|
| 45 |
+
guide_kwargs = {"classifier_kwargs": {}}
|
| 46 |
if "expert_llm" in config:
|
| 47 |
if "model_id" in config["expert_llm"]:
|
| 48 |
guide_kwargs["expert_model"] = config["expert_llm"]["model_id"]
|