Spaces:
Sleeping
Sleeping
File size: 637 Bytes
c252082 fb068e1 8ceaf30 9abc4dc c252082 d1f1944 c252082 8ceaf30 c252082 d8775b9 c252082 4a2aa13 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import gradio as gr
import torch
import os
from dalle_mini import DalleBart
from transformers import pipeline
from huggingface_hub import InferenceClient
from huggingface_hub import login
login(token=os.getenv('HF_TOKEN'))
pipe = DalleBart.from_pretrained("dalle-mini/dalle-mini", dtype="auto")
def image_gen(prompt):
image = pipe(prompt).images[0]
iface = gr.Interface(
fn=image_gen,
inputs=gr.Textbox(lines=2,placeholder="Enter your prompt here..."),
outputs=gr.Image(type="pil"),
title="Text-to-Image Generator with VLM",
description="Generate images from text prompts using a Vision-Language Model."
) |