Spaces:
Sleeping
Sleeping
dominguezdaniel
commited on
Commit
•
c45b9d6
1
Parent(s):
6107458
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ model = BartForConditionalGeneration.from_pretrained(model_name)
|
|
11 |
|
12 |
def generate_tweet(label):
|
13 |
# Generate a promotional tweet using a GPT-like model
|
14 |
-
prompt = "Write a tweet about {label}:"
|
15 |
inputs = tokenizer.encode(prompt, return_tensors="pt")
|
16 |
outputs = model.generate(inputs, max_length=280, num_return_sequences=1)
|
17 |
tweet = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
|
|
11 |
|
12 |
def generate_tweet(label):
|
13 |
# Generate a promotional tweet using a GPT-like model
|
14 |
+
prompt = f"Write a tweet about {label}:"
|
15 |
inputs = tokenizer.encode(prompt, return_tensors="pt")
|
16 |
outputs = model.generate(inputs, max_length=280, num_return_sequences=1)
|
17 |
tweet = tokenizer.decode(outputs[0], skip_special_tokens=True)
|