Skip to content

Commit

Permalink
Merge branch 'qs-parms'
Browse files Browse the repository at this point in the history
  • Loading branch information
steventkrawczyk committed Aug 4, 2023
2 parents 4053948 + 7679135 commit 19bf7c4
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
project = "prompttools"
copyright = "2023, Hegel AI"
author = "Hegel AI"
release = "0.0.27"
release = "0.0.29"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
36 changes: 27 additions & 9 deletions prompttools/playground/playground.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@


import streamlit as st
import pyperclip
import urllib.parse

try:
import os
Expand All @@ -24,6 +26,7 @@


params = st.experimental_get_query_params()
st.experimental_set_query_params()

st.header("PromptTools Playground")
st.write("Give us a \U00002B50 on [GitHub](https://github.com/hegelai/prompttools)")
Expand Down Expand Up @@ -134,11 +137,13 @@
placeholders[i][j] = st.empty() # placeholders for the future output
st.divider()

buttons = st.columns(2)
with buttons[0]:
run_button, clear_button, share_button = st.columns([1, 1, 1], gap="small")
with run_button:
run = st.button("Run")
with buttons[1]:
with clear_button:
clear = st.button("Clear")
with share_button:
share = st.button("Share")

if run:
df = load_data(
Expand Down Expand Up @@ -192,11 +197,13 @@
placeholders[i][j] = st.empty() # placeholders for the future output
st.divider()

buttons = st.columns(2)
with buttons[0]:
run_button, clear_button, share_button = st.columns([1, 1, 1], gap="small")
with run_button:
run = st.button("Run")
with buttons[1]:
with clear_button:
clear = st.button("Clear")
with share_button:
share = st.button("Share")

if run:
prompts = render_prompts(templates, vars)
Expand Down Expand Up @@ -285,11 +292,13 @@
placeholders[i][j] = st.empty() # placeholders for the future output
st.divider()

buttons = st.columns(2)
with buttons[0]:
run_button, clear_button, share_button = st.columns([1, 1, 1], gap="small")
with run_button:
run = st.button("Run")
with buttons[1]:
with clear_button:
clear = st.button("Clear")
with share_button:
share = st.button("Share")

if run:
dfs = run_multiple(
Expand All @@ -309,3 +318,12 @@
if clear:
for key in st.session_state.keys():
del st.session_state[key]


if share:
link = "https://prompttools.streamlit.app?"
link += "model_type=" + urllib.parse.quote(model_type)
link += "&model=" + urllib.parse.quote(model)
link += "&instruction=" + urllib.parse.quote(instructions[0])
link += "&prompt=" + urllib.parse.quote(prompts[0])
pyperclip.copy(link)
3 changes: 2 additions & 1 deletion prompttools/playground/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ prompttools
jinja2
huggingface_hub
llama-cpp-python
anthropic
anthropic
pyperclip
4 changes: 2 additions & 2 deletions prompttools/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = '0.0.27a0+ec8b28a'
git_version = 'ec8b28a3aa242255a02464955d60c4660fb4af55'
__version__ = '0.0.29a0+a615112'
git_version = 'a615112b97f81ce47704701157e9b8bbd4215815'
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "prompttools"
version = "0.0.27"
version = "0.0.29"
authors = [
{ name="Hegel AI", email="[email protected]" },
]
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.27a0
0.0.29a0

0 comments on commit 19bf7c4

Please sign in to comment.