커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
Interface 사용법에 대한 질문입니다.
[스킬업] AI가 처음이어도 쉽게 배우는 생성형 AI A to Z v0
2주차
북마크
고*희
댓글
3
추천
0
조회수
8
조회수
8
답변 완료

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

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


inputs parameter 에 text box 두개를 사용했어요.

examples parameter를 사용하고 싶은데요 , 이렇게 저렇게 해봐도 에러가 납니다.

도와주세요 .



보고 계신 화면 전체를

스파르타 즉문즉답

캡처해 주시면, 튜터님들이 빠르게 상황을 이해할 수 있어요.




from transformers import pipeline

import gradio as gr

#질의응답

question_answerer = pipeline("question-answering")

"""

result = question_answerer(

    question="Where do I work?",

    context="My name is Jiwoong and I work at Spartacoding Club in Seoul.",

)

"""

def answering (text,description):

  result = question_answerer(

  question = text,

  context = description,

 

  )


#answerdic ={}

#print(type(result))


# for entity in result:

#   print (entity)

 

  return result['answer'],result['score']


interface = gr.Interface(

    fn = answering,

    inputs = [gr.Textbox(label="Question"),gr.Textbox(label="Text for question")],

    outputs = gr.Textbox(label ='Result'),

    #examples=["Where do I work?","My name is Jiwoong and I work at Spartacoding Club in Seoul."],

)

interface.launch(debug=True,share=True)



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