From a5754391725a8bd76d0c7c0a6d8d84177b5e5b03 Mon Sep 17 00:00:00 2001 From: Fabian Sommer Date: Fri, 2 Feb 2024 15:01:47 +0100 Subject: [PATCH 1/6] Fix build --- MANIFEST.in | 21 +++++++++------------ src/lmql/ui/playground/__init__.py | 0 2 files changed, 9 insertions(+), 12 deletions(-) create mode 100644 src/lmql/ui/playground/__init__.py diff --git a/MANIFEST.in b/MANIFEST.in index ad6c4f7f..01b856c9 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,12 +1,9 @@ -include src/lmql/ui/* -recursive-include src/lmql/ui/playground/ * -<<<<<<< HEAD -======= -recursive-exclude src/lmql/ui/playground/build/ * ->>>>>>> a231d6cbbb15091ac273a309f36b8c9d5f5b6c89 -recursive-include src/lmql/lib/chat/assets/ * -recursive-include src/lmql/ui/live/ * -recursive-exclude src/lmql/ui/live/node_modules/ * -recursive-exclude src/lmql/ui/live/ *.tokens -recursive-exclude src/lmql/ui/playground/node_modules/ * -recursive-exclude src/lmql/ui/vscode/ * \ No newline at end of file +include src/lmql/ui * +recursive-include src/lmql/ui/playground * +recursive-exclude src/lmql/ui/playground/build * +recursive-exclude src/lmql/ui/playground/node_modules * +recursive-include src/lmql/lib/chat/assets * +recursive-include src/lmql/ui/live * +recursive-exclude src/lmql/ui/live/node_modules * +recursive-exclude src/lmql/ui/live *.tokens +recursive-exclude src/lmql/ui/vscode * \ No newline at end of file diff --git a/src/lmql/ui/playground/__init__.py b/src/lmql/ui/playground/__init__.py new file mode 100644 index 00000000..e69de29b From 19b55d615f1eabcc7ee15720e7fba520a2aeae49 Mon Sep 17 00:00:00 2001 From: Fabian Sommer Date: Fri, 2 Feb 2024 15:27:22 +0100 Subject: [PATCH 2/6] Fix playground --- src/lmql/cli.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lmql/cli.py b/src/lmql/cli.py index 7d9c6e5d..d442029e 100755 --- a/src/lmql/cli.py +++ b/src/lmql/cli.py @@ -9,6 +9,8 @@ project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +is_windows = os.name == "nt" # Necessary to properly run yarn using subprocess.run on Windows + def cmd_serve_model(): """emoji:🏄 Serve a 🤗 Transformers model via the LMQL inference API""" from lmql.models.lmtp.lmtp_serve import cli @@ -124,7 +126,7 @@ def cmd_playground(): print(f"[lmql playground {project_root}, liveserver=localhost:{args.live_port}, ui=localhost:{args.ui_port}]") # # make sure yarn is installed - if subprocess.call(["yarn", "--version"]) != 0: + if subprocess.call(["yarn", "--version"], shell=is_windows) != 0: subprocess.run(['npm', 'install', '-g', 'yarn'], check=True) # repo commit @@ -140,15 +142,16 @@ def cmd_playground(): # Ensure that we can download dependencies before we start either live.js or the debug server yarn_cwd_live = os.path.join(project_root, "lmql/ui/live") - subprocess.run(['yarn'], cwd=yarn_cwd_live, check=True) + subprocess.run(['yarn'], cwd=yarn_cwd_live, check=True, shell=is_windows) yarn_cwd_playground = os.path.join(project_root, 'lmql/ui/playground') - subprocess.run(['yarn'], cwd=yarn_cwd_playground, check=True) + subprocess.run(['yarn'], cwd=yarn_cwd_playground, check=True, shell=is_windows) # live server that executes LMQL queries and returns results and debugger data live_process = subprocess.Popen(['yarn', 'cross-env', 'node', 'live.js'], cwd=yarn_cwd_live, env=dict(os.environ, PORT=str(args.live_port)), + shell=is_windows, ) # UI that displays the debugger (uses live server API for data and remote execution) @@ -156,6 +159,7 @@ def cmd_playground(): ['yarn', 'cross-env', 'yarn', 'run', 'start'], cwd=yarn_cwd_playground, env=dict(os.environ, REACT_APP_BUILD_COMMIT=str(commit), REACT_APP_SOCKET_PORT=str(args.live_port)), + shell=is_windows, ) try: From b7583475eb60a8cc329c165f6695ad945e5faa3d Mon Sep 17 00:00:00 2001 From: Luca Beurer-Kellner Date: Wed, 14 Feb 2024 21:39:49 +0100 Subject: [PATCH 3/6] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a114ce1d..a3cc1317 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@

+### >> Help us shape the next major version of LMQL and fill out the LMQL developer survey here: https://forms.gle/pGvAicNpUhS1rAkK9 (5-question) << + LMQL is a programming language for large language models (LLMs) based on a *superset of Python*. LMQL offers a novel way of interweaving traditional programming with the ability to call LLMs in your code. It goes beyond traditional templating languages by integrating LLM interaction natively at the level of your program code. ## Explore LMQL From 536ab3008abfad1f3d16f4cf1a7cff60bec41edd Mon Sep 17 00:00:00 2001 From: Luca Beurer-Kellner Date: Wed, 14 Feb 2024 21:41:46 +0100 Subject: [PATCH 4/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a3cc1317..ffeb2d46 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@

-### >> Help us shape the next major version of LMQL and fill out the LMQL developer survey here: https://forms.gle/pGvAicNpUhS1rAkK9 (5-question) << +### >> Help us shape the next major version of LMQL and fill out the LMQL developer survey here: https://forms.gle/pGvAicNpUhS1rAkK9 (5 question) << LMQL is a programming language for large language models (LLMs) based on a *superset of Python*. LMQL offers a novel way of interweaving traditional programming with the ability to call LLMs in your code. It goes beyond traditional templating languages by integrating LLM interaction natively at the level of your program code. ## Explore LMQL From e37950408df9477e478097ca5bb31cc5966ab56e Mon Sep 17 00:00:00 2001 From: Luca Beurer-Kellner Date: Wed, 14 Feb 2024 21:53:53 +0100 Subject: [PATCH 5/6] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ffeb2d46..0b7984c1 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,9 @@

-### >> Help us shape the next major version of LMQL and fill out the LMQL developer survey here: https://forms.gle/pGvAicNpUhS1rAkK9 (5 question) << + + +> image
Help us shape the next major version of LMQL by filling out the LMQL developer survey: https://forms.gle/pGvAicNpUhS1rAkK9 LMQL is a programming language for large language models (LLMs) based on a *superset of Python*. LMQL offers a novel way of interweaving traditional programming with the ability to call LLMs in your code. It goes beyond traditional templating languages by integrating LLM interaction natively at the level of your program code. ## Explore LMQL From 42fccbecda2990b8fc1530a1e421d3252dcc02ef Mon Sep 17 00:00:00 2001 From: Luca Beurer-Kellner Date: Wed, 14 Feb 2024 21:55:57 +0100 Subject: [PATCH 6/6] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0b7984c1..dc7ac9e1 100644 --- a/README.md +++ b/README.md @@ -24,10 +24,10 @@ +LMQL is a programming language for large language models (LLMs) based on a *superset of Python*. LMQL offers a novel way of interweaving traditional programming with the ability to call LLMs in your code. It goes beyond traditional templating languages by integrating LLM interaction natively at the level of your program code. -> image
Help us shape the next major version of LMQL by filling out the LMQL developer survey: https://forms.gle/pGvAicNpUhS1rAkK9 +> image
Help us shape the next major version of LMQL by filling out the LMQL developer survey: https://forms.gle/pGvAicNpUhS1rAkK9 -LMQL is a programming language for large language models (LLMs) based on a *superset of Python*. LMQL offers a novel way of interweaving traditional programming with the ability to call LLMs in your code. It goes beyond traditional templating languages by integrating LLM interaction natively at the level of your program code. ## Explore LMQL An LMQL program reads like standard Python, but top-level strings are interpreted as query strings: They are passed to an LLM, where template variables like `[GREETINGS]` are automatically completed by the model: