Download add.py from Manggomee/test: direct link, hf CLI and curl.
- Browser
- Download file 509 Bytes
-
https://huggingface.co/spaces/Manggomee/test/resolve/main/add.py
- Command line
-
hf download hf://spaces/Manggomee/test/add.py
-
curl -L -o add.py https://huggingface.co/spaces/Manggomee/test/resolve/main/add.py
509 Bytes
| print('add.py 실행 시작!') | |
| from transformers import pipeline | |
| import gradio as gr | |
| qna = pipeline("question-answering") | |
| def answer_question(question, context): | |
| result = qna({ | |
| "question": question, | |
| "context": context | |
| }) | |
| if isinstance(result, list): | |
| return result[0]['answer'] | |
| return result['answer'] | |
| demo = gr.Interface( | |
| fn=answer_question, | |
| inputs=["text", "text"], | |
| outputs="text", | |
| title="Question Answering" | |
| ) | |
| demo.launch() | |