Skip to content

Commit

Permalink
fixed linting
Browse files Browse the repository at this point in the history
  • Loading branch information
lightrag committed Jan 20, 2025
1 parent d9a2285 commit 326057d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions lightrag/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,11 @@ async def ollama_model_if_cache(
timeout = kwargs.pop("timeout", None)
kwargs.pop("hashing_kv", None)
api_key = kwargs.pop("api_key", None)
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {api_key}"
} if api_key else {"Content-Type": "application/json"}
headers = (
{"Content-Type": "application/json", "Authorization": f"Bearer {api_key}"}
if api_key
else {"Content-Type": "application/json"}
)
ollama_client = ollama.AsyncClient(host=host, timeout=timeout, headers=headers)
messages = []
if system_prompt:
Expand Down Expand Up @@ -386,10 +387,11 @@ async def lollms_model_if_cache(

stream = True if kwargs.get("stream") else False
api_key = kwargs.pop("api_key", None)
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {api_key}"
} if api_key else {"Content-Type": "application/json"}
headers = (
{"Content-Type": "application/json", "Authorization": f"Bearer {api_key}"}
if api_key
else {"Content-Type": "application/json"}
)

# Extract lollms specific parameters
request_data = {
Expand Down

0 comments on commit 326057d

Please sign in to comment.