Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: format code with Autopep8 #22

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions python/openwebui/pipe_mcts.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ def get_chunk_content(self, chunk):
if "content" in delta:
yield delta["content"]
except json.JSONDecodeError:
logger.error(f'ChunkDecodeError: unable to parse "{chunk_str[:100]}"')
logger.error(
f'ChunkDecodeError: unable to parse "{chunk_str[:100]}"')


# =============================================================================
Expand Down Expand Up @@ -441,7 +442,8 @@ async def update_approach(self, answer: str, improvements: str):
return await self.generate_completion(prompt)

async def evaluate_answer(self, answer: str):
prompt = eval_answer_prompt.format(question=self.question, answer=answer)
prompt = eval_answer_prompt.format(
question=self.question, answer=answer)
result = await self.generate_completion(prompt)
try:
score = int(re.search(r"\d+", result).group())
Expand Down Expand Up @@ -672,7 +674,8 @@ async def pipe(
if match:
backend, model_name = match.groups()
else:
logger.error("Model ID should be in the format '*.mcts/backend/model_name'")
logger.error(
"Model ID should be in the format '*.mcts/backend/model_name'")
logger.error(f"Invalid model ID: {model_id}")
return ""

Expand Down
Loading