File size: 1,086 Bytes
7d1049e 58303c5 7d1049e 58303c5 66a86f0 58303c5 744c751 28bae25 b64758f 744c751 14741a8 58303c5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
---
license: cc-by-nc-4.0
datasets:
- WenhaoWang/VidProM
language:
- en
---
# Description
The first model for automatic text-to-video prompt generation. It finetuned on [VidProM](https://huggingface.co/datasets/WenhaoWang/VidProM) using [Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1).
# Usage
## Download the model
```
from transformers import pipeline
pipe = pipeline("text-generation", model="WenhaoWang/AutoT2VPrompt")
```
## Set the Parameters
```
input = "An undemwater world"
max_length = 50
temperature = 1.2
top_k = 8
num_return_sequences = 10
```
## Generation
```
all_prompts = pipe(input, max_length = max_length, do_sample = True, temperature = temperature, top_k = top_k, num_return_sequences=num_return_sequences)
def process(text):
text = text.replace('\n', '.')
text = text.replace(' .', '.')
text = text[:text.rfind('.')]
text = text + '.'
return text
for i in range(num_return_sequences):
print(all_prompts[i]['generated_text'])
```
You will get 10 text-to-video prompts, and you can pick one you like most.
# Demo |