Skip to content

Commit 64b0dd8

Browse files
committed
feat: fix model name initializations!
1 parent 7e84052 commit 64b0dd8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

agentic_rag/gradio_app.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,9 @@ def chat(message: str, history: List[List[str]], agent_type: str, use_cot: bool,
141141
quantization = "8bit"
142142
model_type = "Local (Mistral)"
143143
elif "Ollama" in agent_type:
144+
# Extract model name from agent_type (e.g., "Ollama - deepseek-r1" -> "deepseek-r1")
145+
model_name = agent_type.replace("Ollama - ", "").strip()
144146
model_type = "Ollama"
145-
# Model name will be extracted later
146147
else:
147148
model_type = agent_type
148149

@@ -156,10 +157,7 @@ def chat(message: str, history: List[List[str]], agent_type: str, use_cot: bool,
156157
agent = LocalRAGAgent(vector_store, use_cot=use_cot, collection=collection,
157158
skip_analysis=skip_analysis, quantization=quantization)
158159
elif "Ollama" in model_type:
159-
# For Ollama models
160-
# Extract model name directly from the model_type
161-
model_name = model_type.replace("Ollama - ", "").strip()
162-
160+
# For Ollama models, use the extracted model_name directly
163161
try:
164162
agent = LocalRAGAgent(vector_store, model_name=model_name, use_cot=use_cot,
165163
collection=collection, skip_analysis=skip_analysis)

0 commit comments

Comments
 (0)