langchain/langchain/server.py
Keshav Kumar 8fdf88b8e3
Fix for ModuleNotFoundError while running langchain-server. Issue #5833 (#6077)
This PR fixes the error
`ModuleNotFoundError: No module named 'langchain.cli'`
Fixes https://github.com/hwchase17/langchain/issues/5833 (issue)
2023-06-13 08:37:07 -07:00

19 lines
541 B
Python

"""Script to run langchain-server locally using docker-compose."""
import subprocess
from pathlib import Path
from langchainplus_sdk.cli.main import get_docker_compose_command
def main() -> None:
"""Run the langchain server locally."""
p = Path(__file__).absolute().parent / "docker-compose.yaml"
docker_compose_command = get_docker_compose_command()
subprocess.run([*docker_compose_command, "-f", str(p), "pull"])
subprocess.run([*docker_compose_command, "-f", str(p), "up"])
if __name__ == "__main__":
main()