Skip to content

Commit

Permalink
prompt to use 75% of max tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
PsicoThePato committed May 15, 2024
1 parent 0e6a24a commit f002884
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/synthia/miner/BaseLLM.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def get_context_prompt(self, max_tokens: int) -> str:
"yourself clear and concisely, crystallizing thoughts and "
"key concepts. You only respond with the explanations themselves, "
"eliminating redundant conversational additions. "
f"Try to keep your answer below {max_tokens} tokens"
f"Keep your answer below {int(max_tokens * 0.75)} tokens"
)
return prompt

Expand Down
6 changes: 3 additions & 3 deletions src/synthia/miner/anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(self, settings: AnthropicSettings | None = None) -> None:
"yourself clear and concisely, crystallizing thoughts and "
"key concepts. You only respond with the explanations themselves, "
"eliminating redundant conversational additions. "
f"Try to keep your answer below {self.settings.max_tokens} tokens"
f"Keep your answer below {int(self.settings.max_tokens * 0.75)} tokens"
)

def prompt(self, user_prompt: str, system_prompt: str | None | NotGiven = None):
Expand Down Expand Up @@ -140,9 +140,9 @@ def prompt(self, user_prompt: str, system_prompt: str | None = None):
log(f"Running module with key {key.ss58_address}")
claude = OpenrouterModule()
refill_rate = 1/400
bucket = TokenBucketLimiter(2, refill_rate)
bucket = TokenBucketLimiter(15, refill_rate)
server = ModuleServer(
claude, key, ip_limiter=bucket, subnets_whitelist=[3]
claude, key, ip_limiter=bucket, subnets_whitelist=None
)
app = server.get_fastapi_app()
uvicorn.run(app, host="127.0.0.1", port=8000)
2 changes: 1 addition & 1 deletion src/synthia/validator/generate_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def gen_explanation(
"yourself clear and concisely, crystallizing thoughts and "
"key concepts. You only respond with the explanations themselves, "
"eliminating redundant conversational additions. "
f"Try to keep your answer below {self.llm.max_tokens} tokens"
f"Keep your answer below {int(self.llm.max_tokens * 0.75)} tokens"
)

user_prompt, criteria = explanation_prompt()
Expand Down

0 comments on commit f002884

Please sign in to comment.