mrm8488 commited on
Commit
2203509
·
1 Parent(s): 8f67185

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -3,9 +3,9 @@ import streamlit as st
3
 
4
  from transformers import AutoTokenizer, AutoModelWithLMHead
5
 
6
- tokenizer = AutoTokenizer.from_pretrained("gpt2-large")
7
 
8
- model = AutoModelWithLMHead.from_pretrained("gpt2-large")
9
 
10
 
11
 
@@ -26,7 +26,7 @@ def infer(input_ids, max_length, temperature, top_k, top_p, num_return_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 Transformers 🦄")
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)
 
3
 
4
  from transformers import AutoTokenizer, AutoModelWithLMHead
5
 
6
+ tokenizer = AutoTokenizer.from_pretrained("mrm8488/spanish-gpt2")
7
 
8
+ model = AutoModelWithLMHead.from_pretrained("mrm8488/spanish-gpt2")
9
 
10
 
11
 
 
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)