mrm8488 commited on
Commit
1f57ae8
1 Parent(s): 2203509

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -8,8 +8,6 @@ tokenizer = AutoTokenizer.from_pretrained("mrm8488/spanish-gpt2")
8
  model = AutoModelWithLMHead.from_pretrained("mrm8488/spanish-gpt2")
9
 
10
 
11
-
12
-
13
  def infer(input_ids, max_length, temperature, top_k, top_p, num_return_sequences):
14
 
15
  output_sequences = model.generate(
@@ -23,10 +21,10 @@ def infer(input_ids, max_length, temperature, top_k, top_p, num_return_sequences
23
  )
24
 
25
  return output_sequences
26
- default_value = "See how a modern neural network auto-completes your text 🤗 This site, built by the Hugging Face team, lets you write a whole document directly from your browser, and you can trigger the Transformer anywhere using the Tab key. Its like having a smart machine that completes your thoughts 😀 Get started by typing a custom snippet, check out the repository, or try one of the examples. Have fun!"
27
 
28
  #prompts
29
- st.title("Write with Spanish GPT-2 🦄")
30
  st.write("The almighty king of text generation, GPT-2 comes in four available sizes, only three of which have been publicly made available. Feared for its fake news generation capabilities, it currently stands as the most syntactically coherent model. A direct successor to the original GPT, it reinforces the already established pre-training/fine-tuning killer duo. From the paper: Language Models are Unsupervised Multitask Learners by Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei and Ilya Sutskever.")
31
 
32
  sent = st.text_area("Text", default_value, height = 275)
@@ -67,5 +65,4 @@ for generated_sequence_idx, generated_sequence in enumerate(output_sequences):
67
  print(total_sequence)
68
 
69
 
70
- st.write(generated_sequences[-1])
71
-
 
8
  model = AutoModelWithLMHead.from_pretrained("mrm8488/spanish-gpt2")
9
 
10
 
 
 
11
  def infer(input_ids, max_length, temperature, top_k, top_p, num_return_sequences):
12
 
13
  output_sequences = model.generate(
 
21
  )
22
 
23
  return output_sequences
24
+ default_value = "See how a modern neural network auto-completes your text 🤗 This site, built by the Hugging Face team, lets you write a whole document directly from your browser, and you can trigger the Transformer anywhere using the Tab key. Its like having a smart machine that completes your thoughts 😀 Get started by typing a custom snippet, check out the repository, or try one of the examples. Have fun!"
25
 
26
  #prompts
27
+ st.title("Write with Spanish GPT-2 🦄")
28
  st.write("The almighty king of text generation, GPT-2 comes in four available sizes, only three of which have been publicly made available. Feared for its fake news generation capabilities, it currently stands as the most syntactically coherent model. A direct successor to the original GPT, it reinforces the already established pre-training/fine-tuning killer duo. From the paper: Language Models are Unsupervised Multitask Learners by Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei and Ilya Sutskever.")
29
 
30
  sent = st.text_area("Text", default_value, height = 275)
 
65
  print(total_sequence)
66
 
67
 
68
+ st.write(generated_sequences[-1])