PeterBrendan commited on
Commit
39a4d43
·
1 Parent(s): 2f6dbd5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -10,7 +10,7 @@ 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 from that setting onward. Using **{** will generate a Prebid config from the begining.")
14
  st.write("**Intended uses:** This model is intended to assist publishers in understanding and exploring how other publishers configure their Prebid settings. It can serve as a reference to gain insights into common configurations, best practices, and different approaches used by publishers across various domains. To learn more about the model go to: [pbjs_gpt2](https://huggingface.co/PeterBrendan/pbjs_gpt2). [Link to official Prebid Documentation on pbjs.setConfig](https://docs.prebid.org/dev-docs/publisher-api-reference/setConfig.html)")
15
  st.write("*Note:* The model does take some time to run")
16
 
@@ -34,10 +34,16 @@ def main():
34
  # Load the Hugging Face model
35
  generator = load_model()
36
 
 
 
 
 
 
37
  # Generate text based on user input
38
  generated_text = generator(user_input, max_length=700, num_return_sequences=1)[0]["generated_text"]
39
 
40
- # Display the generated text
 
41
  st.write("Generated Text:")
42
  st.write(generated_text)
43
 
 
10
  st.session_state["generated_widget_id"] = None
11
 
12
  st.title("Pbjs GPT2")
13
+ st.write("Enter Prebid config text like **bidderTimeout** and get a generated Prebid config output from that setting onward. Using **{** will generate a Prebid config from the beginning.")
14
  st.write("**Intended uses:** This model is intended to assist publishers in understanding and exploring how other publishers configure their Prebid settings. It can serve as a reference to gain insights into common configurations, best practices, and different approaches used by publishers across various domains. To learn more about the model go to: [pbjs_gpt2](https://huggingface.co/PeterBrendan/pbjs_gpt2). [Link to official Prebid Documentation on pbjs.setConfig](https://docs.prebid.org/dev-docs/publisher-api-reference/setConfig.html)")
15
  st.write("*Note:* The model does take some time to run")
16
 
 
34
  # Load the Hugging Face model
35
  generator = load_model()
36
 
37
+ # Display 'Generating Output' message
38
+ output_placeholder = st.empty()
39
+ with output_placeholder:
40
+ st.write("Generating Output...")
41
+
42
  # Generate text based on user input
43
  generated_text = generator(user_input, max_length=700, num_return_sequences=1)[0]["generated_text"]
44
 
45
+ # Clear 'Generating Output' message and display the generated text
46
+ output_placeholder.empty()
47
  st.write("Generated Text:")
48
  st.write(generated_text)
49