Spaces:
Sleeping
Sleeping
Commit
·
2754cd5
1
Parent(s):
177ebcb
Update app.py
Browse filesadded some default promts
app.py
CHANGED
@@ -6,11 +6,23 @@ def load_model():
|
|
6 |
return pipeline("text-generation", model="PeterBrendan/pbjs_gpt2")
|
7 |
|
8 |
def main():
|
9 |
-
st.title("Pbjs GPT2")
|
10 |
st.write("Enter some text like **bidderTimeout** and get a generated Prebid config output.")
|
11 |
|
12 |
-
#
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
# Check if the user input is empty
|
16 |
if user_input:
|
|
|
6 |
return pipeline("text-generation", model="PeterBrendan/pbjs_gpt2")
|
7 |
|
8 |
def main():
|
9 |
+
st.title("Pbjs GPT2: Optimize your Prebid config")
|
10 |
st.write("Enter some text like **bidderTimeout** and get a generated Prebid config output.")
|
11 |
|
12 |
+
# Default prompts
|
13 |
+
default_prompts = ["{", "bidderTimeout", "bidderSequence", "Usebidcache", "customPriceBucket"]
|
14 |
+
|
15 |
+
# Create a select box for default prompts
|
16 |
+
default_prompt = st.selectbox("Choose a default prompt:", default_prompts)
|
17 |
+
|
18 |
+
# Create a text input field for a custom prompt
|
19 |
+
custom_prompt = st.text_input("Enter a custom prompt:", "")
|
20 |
+
|
21 |
+
# Check if a default prompt is selected
|
22 |
+
if default_prompt:
|
23 |
+
user_input = default_prompt
|
24 |
+
else:
|
25 |
+
user_input = custom_prompt
|
26 |
|
27 |
# Check if the user input is empty
|
28 |
if user_input:
|