Spaces:
Sleeping
Sleeping
Commit
·
50f573d
1
Parent(s):
92d45bc
Update app.py
Browse files
app.py
CHANGED
@@ -10,10 +10,11 @@ def main():
|
|
10 |
st.session_state["generated_widget_id"] = None
|
11 |
|
12 |
st.title("Pbjs GPT2")
|
13 |
-
st.write("Enter some text like **bidderTimeout** and get a generated Prebid config output.")
|
14 |
-
|
|
|
15 |
# Default prompts
|
16 |
-
default_prompts = ["
|
17 |
|
18 |
# Create a selectbox for default prompts
|
19 |
default_prompt = st.selectbox("Choose a default prompt:", default_prompts)
|
@@ -33,7 +34,7 @@ def main():
|
|
33 |
generator = load_model()
|
34 |
|
35 |
# Generate text based on user input
|
36 |
-
generated_text = generator(user_input, max_length=
|
37 |
|
38 |
# Display the generated text
|
39 |
st.write("Generated Text:")
|
|
|
10 |
st.session_state["generated_widget_id"] = None
|
11 |
|
12 |
st.title("Pbjs GPT2")
|
13 |
+
st.write("Enter some text like **bidderTimeout** and get a generated Prebid config output. Using **{** will generate a Prebid config from the begining.")
|
14 |
+
st.write("*Note:* The model does take some time to run")
|
15 |
+
|
16 |
# Default prompts
|
17 |
+
default_prompts = ["{", "bidderTimeout", "bidderSequence", "Usebidcache", "customPriceBucket"]
|
18 |
|
19 |
# Create a selectbox for default prompts
|
20 |
default_prompt = st.selectbox("Choose a default prompt:", default_prompts)
|
|
|
34 |
generator = load_model()
|
35 |
|
36 |
# Generate text based on user input
|
37 |
+
generated_text = generator(user_input, max_length=700, num_return_sequences=1)[0]["generated_text"]
|
38 |
|
39 |
# Display the generated text
|
40 |
st.write("Generated Text:")
|