Spaces:
Runtime error
Runtime error
Commit
·
e4c6f46
1
Parent(s):
304baf7
Update app.py
Browse files
app.py
CHANGED
@@ -13,9 +13,9 @@ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
13 |
# Define a function for generating text based on a prompt using the fine-tuned GPT-2 model and the tokenizer
|
14 |
def generate_text(prompt, length=100, theme=None, **kwargs):
|
15 |
|
16 |
-
model_url = "https://huggingface.co/spaces/sailormars18/Yelp-reviews-usingGPT2/
|
17 |
-
config_url = "https://huggingface.co/spaces/sailormars18/Yelp-reviews-usingGPT2/
|
18 |
-
generation_config_url = "https://huggingface.co/spaces/sailormars18/Yelp-reviews-usingGPT2/
|
19 |
|
20 |
# Load the model from the Hugging Face space
|
21 |
model = transformers.GPT2LMHeadModel.from_pretrained(model_url, config=config_url).to(device)
|
|
|
13 |
# Define a function for generating text based on a prompt using the fine-tuned GPT-2 model and the tokenizer
|
14 |
def generate_text(prompt, length=100, theme=None, **kwargs):
|
15 |
|
16 |
+
model_url = "https://huggingface.co/spaces/sailormars18/Yelp-reviews-usingGPT2/raw/main/pytorch_model.bin"
|
17 |
+
config_url = "https://huggingface.co/spaces/sailormars18/Yelp-reviews-usingGPT2/raw/main/config.json"
|
18 |
+
generation_config_url = "https://huggingface.co/spaces/sailormars18/Yelp-reviews-usingGPT2/raw/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)
|