Skip to content

Commit

Permalink
fix bugs when running easy simple server (sotopia-lab#144)
Browse files Browse the repository at this point in the history
* fix bugs in easy simple server

* fix an error occured in type checking of langchain
  • Loading branch information
bugsz authored Sep 25, 2023
1 parent 036caf3 commit 1ecd841
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sotopia/generation_utils/langchain_callback_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def on_tool_end(
pass

def on_tool_error(
self, error: Exception | KeyboardInterrupt, **kwargs: Any
self, error: BaseException | KeyboardInterrupt, **kwargs: Any
) -> None:
"""Do nothing."""
pass
Expand Down
2 changes: 1 addition & 1 deletion sotopia/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ async def arun_one_episode(
@beartype
async def run_async_server(
model_dict: dict[str, LLM_Name],
sampler: BaseSampler[Observation, AgentAction],
sampler: BaseSampler[Observation, AgentAction] = UniformSampler(),
action_order: Literal[
"simutaneous", "round-robin", "random"
] = "round-robin",
Expand Down
4 changes: 1 addition & 3 deletions sotopia_conf/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,14 @@


def main(_: Any) -> None:
run_async_server_gin = gin.configurable(run_async_server)

parse_gin_flags(
# User-provided gin paths take precedence if relative paths conflict.
FLAGS.gin_search_paths + _DEFAULT_GIN_SEARCH_PATHS,
FLAGS.gin_file,
FLAGS.gin_bindings,
)

asyncio.run(run_async_server_gin()) # type: ignore[call-arg]
asyncio.run(run_async_server()) # type: ignore[call-arg]


if __name__ == "__main__":
Expand Down

0 comments on commit 1ecd841

Please sign in to comment.