miwojc commited on
Commit
9996138
1 Parent(s): c40429a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -9
app.py CHANGED
@@ -74,13 +74,13 @@ do_sample = st.sidebar.selectbox(
74
  # Body
75
  st.markdown(
76
  """
77
- This demo showcases the text generation capabilities for papuGaPT2, a GPT2 model pre-trained from scratch using Polish subset of the multilingual Oscar corpus.
78
 
79
- To use it, add your text to 'Enter Text' box, or click one of the examples in 'Prompt' drop-down list to load them and clik 'Run' button. The model will generate text based on the entered text (prompt).
80
 
81
  For more information including dataset, training and evaluation procedure, intended use, limitations and bias analysis see the [model card](https://huggingface.co/flax-community/papuGaPT2)
82
 
83
- In this demo, we used the template from the wonderful demo of [Spanish GPT2 demo](https://huggingface.co/spaces/flax-community/spanish-gpt2) especially María Grandury and Manuel Romero.
84
  """
85
  )
86
  model_name = MODEL_URL
@@ -117,10 +117,6 @@ if st.button("Run"):
117
  st.write(f"{error}")
118
  else:
119
  result = result[0]["generated_text"]
120
- st.write(result.replace("\
121
- ", " \
122
- "))
123
  st.text("English translation")
124
- st.write(translate(result, "en", "pl").replace("\
125
- ", " \
126
- "))
 
74
  # Body
75
  st.markdown(
76
  """
77
+ This demo showcases the text generation capabilities of the papuGaPT2, a GPT2 model pre-trained from scratch using Polish subset of the multilingual Oscar corpus.
78
 
79
+ To use it, add your text to 'Enter Text' box, or click one of the examples in 'Prompt' drop-down list to load them and click 'Run' button. The model will generate text based on the entered text (prompt).
80
 
81
  For more information including dataset, training and evaluation procedure, intended use, limitations and bias analysis see the [model card](https://huggingface.co/flax-community/papuGaPT2)
82
 
83
+ In this demo, we used the template from the wonderful demo of [Spanish GPT2 team](https://huggingface.co/spaces/flax-community/spanish-gpt2) especially María Grandury and Manuel Romero.
84
  """
85
  )
86
  model_name = MODEL_URL
 
117
  st.write(f"{error}")
118
  else:
119
  result = result[0]["generated_text"]
120
+ st.write(result.replace("\n", " \n"))
 
 
121
  st.text("English translation")
122
+ st.write(translate(result, "en", "pl").replace("\n", " \n"))