sailormars18 commited on
Commit
f900d24
·
1 Parent(s): 99fbd97

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -18,10 +18,10 @@ def generate_text(prompt, length=100, theme=None, **kwargs):
18
  generation_config_url = "https://huggingface.co/spaces/sailormars18/Yelp-reviews-usingGPT2/blob/main/generation_config.json"
19
 
20
  # Load the model from the Hugging Face space
21
- model = transformers.GPT2LMHeadModel.from_pretrained(model_url, config=config_url).to(device)
22
 
23
  # Load the tokenizer from the Hugging Face space
24
- tokenizer = transformers.GPT2Tokenizer.from_pretrained('gpt2')
25
 
26
  # If a theme is specified, add it to the prompt as a prefix for a special token
27
  if theme:
 
18
  generation_config_url = "https://huggingface.co/spaces/sailormars18/Yelp-reviews-usingGPT2/blob/main/generation_config.json"
19
 
20
  # Load the model from the Hugging Face space
21
+ model = transformers.GPT2LMHeadModel.from_pretrained(model_url).to(device)
22
 
23
  # Load the tokenizer from the Hugging Face space
24
+ tokenizer = transformers.GPT2Tokenizer.from_pretrained(config_url)
25
 
26
  # If a theme is specified, add it to the prompt as a prefix for a special token
27
  if theme: