커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
오류
AI가 처음이어도 쉽게 배우는 생성형 AI A to Z v0
2주차
북마크
조*연
댓글
4
추천
0
조회수
7
조회수
7
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.


import numpy as np

import gradio as gr



def flip_text(x):

    return x[::-1]



def flip_image(x):

    return np.fliplr(x)



with gr.Blocks() as demo:

    gr.Markdown("Flip text or image files using this demo.")

   

    with gr.Tab("Flip text"):

        text_input = gr.Textbox()

        text_output = gr.Textbox()

        text_button = gr.Button("Flip")

    with gr.Tab("Flip Image"):

        with gr.Row():

              image_input = gr.Image()

              image_output = gr.Image()

      image_button = gr.Button("Flip")


    with gr.Accordion("Open for More!"):

        gr.Markdown("Look at me...")


    text_button.click(flip_text, inputs=text_input, outputs=text_output)

    image_button.click(flip_image, inputs=image_input, outputs=image_output)


demo.launch(share=True)




스파르타 즉문즉답






취소
 공유
취소
댓글 0
댓글 알림
나의얼굴