Spaces:
Running
Running
Commit
路
c361e08
1
Parent(s):
1eb0633
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,12 @@ import subprocess
|
|
4 |
from gtts import gTTS
|
5 |
from pydub import AudioSegment
|
6 |
from transformers import GPT2LMHeadModel, GPT2Tokenizer, pipeline
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
model = GPT2LMHeadModel.from_pretrained("salomonsky/deepSP")
|
9 |
os.environ["TOKENIZERS_PARALLELISM"] = "true"
|
@@ -47,7 +53,7 @@ iface = gr.Interface(
|
|
47 |
inputs=[
|
48 |
gr.inputs.Textbox(lines=1, label="Nombre", placeholder="Ingresa tu nombre"),
|
49 |
gr.inputs.Textbox(lines=1, label="Fecha de Nacimiento", placeholder="DD/MM/AAAA"),
|
50 |
-
gr.inputs.Radio(choices, label="Selecciona una imagen:", thumbnails=[get_thumbnail(image) for image in choices])
|
51 |
],
|
52 |
outputs=[
|
53 |
gr.outputs.Video(label="Respuesta de Andrea (un minuto aproximadamente)").style(width=256),
|
|
|
4 |
from gtts import gTTS
|
5 |
from pydub import AudioSegment
|
6 |
from transformers import GPT2LMHeadModel, GPT2Tokenizer, pipeline
|
7 |
+
from PIL import Image
|
8 |
+
|
9 |
+
def get_thumbnail(image_path, width):
|
10 |
+
image = Image.open(image_path)
|
11 |
+
image.thumbnail((width, width))
|
12 |
+
return image
|
13 |
|
14 |
model = GPT2LMHeadModel.from_pretrained("salomonsky/deepSP")
|
15 |
os.environ["TOKENIZERS_PARALLELISM"] = "true"
|
|
|
53 |
inputs=[
|
54 |
gr.inputs.Textbox(lines=1, label="Nombre", placeholder="Ingresa tu nombre"),
|
55 |
gr.inputs.Textbox(lines=1, label="Fecha de Nacimiento", placeholder="DD/MM/AAAA"),
|
56 |
+
gr.inputs.Radio(choices, label="Selecciona una imagen:", thumbnails=[get_thumbnail(image, 50) for image in choices])
|
57 |
],
|
58 |
outputs=[
|
59 |
gr.outputs.Video(label="Respuesta de Andrea (un minuto aproximadamente)").style(width=256),
|