fixed linting
This commit is contained in:
parent
d9a22850c5
commit
326057deeb
1 changed files with 10 additions and 8 deletions
|
|
@ -350,10 +350,11 @@ async def ollama_model_if_cache(
|
||||||
timeout = kwargs.pop("timeout", None)
|
timeout = kwargs.pop("timeout", None)
|
||||||
kwargs.pop("hashing_kv", None)
|
kwargs.pop("hashing_kv", None)
|
||||||
api_key = kwargs.pop("api_key", None)
|
api_key = kwargs.pop("api_key", None)
|
||||||
headers = {
|
headers = (
|
||||||
"Content-Type": "application/json",
|
{"Content-Type": "application/json", "Authorization": f"Bearer {api_key}"}
|
||||||
"Authorization": f"Bearer {api_key}"
|
if api_key
|
||||||
} if api_key else {"Content-Type": "application/json"}
|
else {"Content-Type": "application/json"}
|
||||||
|
)
|
||||||
ollama_client = ollama.AsyncClient(host=host, timeout=timeout, headers=headers)
|
ollama_client = ollama.AsyncClient(host=host, timeout=timeout, headers=headers)
|
||||||
messages = []
|
messages = []
|
||||||
if system_prompt:
|
if system_prompt:
|
||||||
|
|
@ -386,10 +387,11 @@ async def lollms_model_if_cache(
|
||||||
|
|
||||||
stream = True if kwargs.get("stream") else False
|
stream = True if kwargs.get("stream") else False
|
||||||
api_key = kwargs.pop("api_key", None)
|
api_key = kwargs.pop("api_key", None)
|
||||||
headers = {
|
headers = (
|
||||||
"Content-Type": "application/json",
|
{"Content-Type": "application/json", "Authorization": f"Bearer {api_key}"}
|
||||||
"Authorization": f"Bearer {api_key}"
|
if api_key
|
||||||
} if api_key else {"Content-Type": "application/json"}
|
else {"Content-Type": "application/json"}
|
||||||
|
)
|
||||||
|
|
||||||
# Extract lollms specific parameters
|
# Extract lollms specific parameters
|
||||||
request_data = {
|
request_data = {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue