Files changed (1) hide show
  1. README.md +29 -2
README.md CHANGED
@@ -1,4 +1,31 @@
1
  ---
2
- license: afl-3.0
 
 
 
 
 
 
 
3
  ---
4
- new
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: creativeml-openrail-m
3
+ datasets:
4
+ - Nerfgun3/bad_prompt
5
+ metrics:
6
+ - bleu
7
+ library_name: diffusers
8
+ tags:
9
+ - art
10
  ---
11
+ from transformers import AutoTokenizer, AutoModel
12
+
13
+ # Cargar el tokenizador y el modelo pre-entrenado
14
+ tokenizer = AutoTokenizer.from_pretrained("image-tokenizers/dall-e-2")
15
+ model = AutoModel.from_pretrained("image-generation/dall-e-2")
16
+
17
+ # texto previo y objetos de imagen para alimentar al modelo
18
+ text = "Crea una imagen de un perro en una bicicleta"
19
+ image = "https://miweb.com/imagenes/perro-bicicleta.png"
20
+
21
+ #Encodear el texto y la imagen
22
+ inputs = tokenizer(text, image, return_tensors='pt')
23
+
24
+ #Generar la imagen
25
+ output = model.generate(**inputs)
26
+
27
+ #Decodificar la imagen generada
28
+ decoded_output = tokenizer.decode(output[0], skip_special_tokens=True)
29
+
30
+ #Imprimir la imagen
31
+ print(decoded_output)