Spaces:
Runtime error
Runtime error
Download app.py from Guilbert12/MinhaPrompt: direct link, hf CLI and curl.
- Browser
- Download file 669 Bytes
-
https://huggingface.co/spaces/Guilbert12/MinhaPrompt/resolve/main/app.py
- Command line
-
hf download hf://spaces/Guilbert12/MinhaPrompt/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Guilbert12/MinhaPrompt/resolve/main/app.py
669 Bytes
| import gradio as gr | |
| from transformers import pipeline | |
| # Cria o gerador de texto com o modelo GPT-2 | |
| gerador = pipeline("text-generation", model="gpt2") | |
| def gerar_prompt(entrada): | |
| prompt = f"Crie um prompt detalhado de vídeo ultra-realista baseado nisso: {entrada}\n" | |
| resultado = gerador(prompt, max_length=250, num_return_sequences=1) | |
| return resultado[0]['generated_text'] | |
| # Interface gráfica do Gradio | |
| iface = gr.Interface( | |
| fn=gerar_prompt, | |
| inputs="text", | |
| outputs="text", | |
| title="Minha IA de Prompts para Vídeos Realistas", | |
| description="Digite sua ideia de vídeo e a IA cria um prompt detalhado pronto para usar." | |
| ) | |
| iface.launch() |