Skip to content

Commit

Permalink
fix: fixed support for local models (specifically through litellm proxy)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Oct 28, 2023
1 parent 4e78303 commit a046004
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gptme/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def init_llm(llm: str):
print("Error: OPENAI_API_BASE not set in env or config, see README.")
sys.exit(1)
openai.api_base = api_base
openai.api_key = "local"
else:
print(f"Error: Unknown LLM: {llm}")
sys.exit(1)
Expand Down Expand Up @@ -97,7 +98,7 @@ def print_clear():
delta = chunk["choices"][0]["delta"]
deltas.append(delta)
delta_str = deltas_to_str(deltas)
stop_reason = chunk["choices"][0]["finish_reason"]
stop_reason = chunk["choices"][0].get("finish_reason", None)
print(deltas_to_str([delta]), end="")
# need to flush stdout to get the print to show up
sys.stdout.flush()
Expand Down

0 comments on commit a046004

Please sign in to comment.