import gradio as gr import spaces import torch zero = torch.Tensor([0]).cuda() print(zero.device) # <-- 'cpu' 🤔 @spaces.GPU def greet(n): print(zero.device) # <-- 'cuda:0' 🤗 return f"Hello {zero + n} Tensor" def one_shot(image_in,input_text,gender): print("Hello") return "htllo123" def run(): with gr.Blocks(css=".gradio-container {background-color: lightgray} #radio_div {background-color: #FFD8B4; font-size: 40px;}") as demo: gr.Markdown("

"+ "One Shot Talking Face from Text" + "



") with gr.Group(): # with gr.Box(): with gr.Row(): # with gr.Row().style(equal_height=True): image_in = gr.Image(show_label=True, type="filepath",label="Input Image") input_text = gr.Textbox(show_label=True,label="Input Text") gender = gr.Radio(["Female","Male"],value="Female",label="Gender") video_out = gr.Video(show_label=True,label="Output") with gr.Row(): # with gr.Row().style(equal_height=True): btn = gr.Button("Generate") # gr.Markdown( # """ #

Feel free to give us your thoughts on this demo and please contact us at # letstalk@pragnakalp.com #

Developed by: Pragnakalp Techlabs

# """) btn.click(one_shot, inputs=[image_in,input_text,gender], outputs=[video_out]) demo.queue() demo.launch(server_name="0.0.0.0", server_port=7860) if __name__ == "__main__": run()