mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
Merge pull request #1054 from James4Ever0/main
Update factory.py to fix issue when calling from write-the -> langchain -> litellm served ollama
This commit is contained in:
commit
4ffe6a4296
1 changed files with 2 additions and 2 deletions
|
|
@ -74,7 +74,7 @@ def ollama_pt(model, messages): # https://github.com/jmorganca/ollama/blob/af4cf
|
|||
messages=messages
|
||||
)
|
||||
else:
|
||||
prompt = "".join(m["content"] for m in messages)
|
||||
prompt = "".join(m["content"] if isinstance(m['content'], str) is str else "".join(m['content']) for m in messages)
|
||||
return prompt
|
||||
|
||||
def mistral_instruct_pt(messages):
|
||||
|
|
@ -397,4 +397,4 @@ def prompt_factory(model: str, messages: list, custom_llm_provider: Optional[str
|
|||
return hf_chat_template(original_model_name, messages)
|
||||
except:
|
||||
return default_pt(messages=messages) # default that covers Bloom, T-5, any non-chat tuned model (e.g. base Llama2)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue