sailormars18 commited on
Commit
d70b501
·
1 Parent(s): 3614153

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -18,7 +18,7 @@ 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("./pytorch_model.bin", config="./config.json").to(device)
22
 
23
  # Load the tokenizer from the Hugging Face space
24
  tokenizer = transformers.GPT2Tokenizer.from_pretrained('gpt2')
 
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')