Skip to content

Commit

Permalink
fixed something
Browse files Browse the repository at this point in the history
  • Loading branch information
xssdoctor committed Mar 6, 2024
1 parent a5d3d71 commit b844511
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions installer/client/cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(self, args, pattern="", env_file="~/.config/fabric/.env", local=Fal
self.claude = claude
if self.local:
if self.args.model == 'gpt-4-turbo-preview':
self.model = 'llama2'
self.args.model = 'llama2'
if self.claude:
if self.args.model == 'gpt-4-turbo-preview':
self.model = 'claude-3-opus-20240229'
Expand All @@ -73,7 +73,7 @@ async def claudeStream(self, system, user):
self.claudeApiKey = os.environ["CLAUDE_API_KEY"]
Streamingclient = AsyncAnthropic(api_key=self.claudeApiKey)
async with Streamingclient.messages.stream(
max_tokens=1024,
max_tokens=4096,
system=system,
messages=[user],
model=self.model, temperature=0.0, top_p=1.0
Expand All @@ -89,7 +89,7 @@ async def claudeChat(self, system, user):
self.claudeApiKey = os.environ["CLAUDE_API_KEY"]
client = Anthropic(api_key=self.claudeApiKey)
message = client.messages.create(
max_tokens=1024,
max_tokens=4096,
system=system,
messages=[user],
model=self.model,
Expand Down Expand Up @@ -169,6 +169,9 @@ def streamMessage(self, input_data: str, context=""):
if "CLAUDE_API_KEY" in str(e):
print(
"Error: CLAUDE_API_KEY not found in environment variables. Please run --setup and add the key")
if "overloaded_error" in str(e):
print(
"Error: Fabric is working fine, but claude is overloaded. Please try again later.")
else:
print(f"Error: {e}")
print(e)
Expand Down Expand Up @@ -237,6 +240,9 @@ def sendMessage(self, input_data: str, context=""):
if "CLAUDE_API_KEY" in str(e):
print(
"Error: CLAUDE_API_KEY not found in environment variables. Please run --setup and add the key")
if "overloaded_error" in str(e):
print(
"Error: Fabric is working fine, but claude is overloaded. Please try again later.")
else:
print(f"Error: {e}")
print(e)
Expand Down

0 comments on commit b844511

Please sign in to comment.