Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,8 +5,9 @@ from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer
|
|
| 5 |
classifier = pipeline("image-classification", model="google/vit-base-patch16-224")
|
| 6 |
|
| 7 |
# Initialize the tokenizer and model for the generative text (GPT-like model)
|
| 8 |
-
|
| 9 |
-
|
|
|
|
| 10 |
|
| 11 |
def generate_tweet(label):
|
| 12 |
# Generate a promotional tweet using a GPT-like model
|
|
|
|
| 5 |
classifier = pipeline("image-classification", model="google/vit-base-patch16-224")
|
| 6 |
|
| 7 |
# Initialize the tokenizer and model for the generative text (GPT-like model)
|
| 8 |
+
model_name = "facebook/bart-large-cnn" # Example BART model for demonstration
|
| 9 |
+
tokenizer = BartTokenizer.from_pretrained(model_name)
|
| 10 |
+
model = BartForConditionalGeneration.from_pretrained(model_name)
|
| 11 |
|
| 12 |
def generate_tweet(label):
|
| 13 |
# Generate a promotional tweet using a GPT-like model
|