Download app.py from Obotu/mini: direct link, hf CLI and curl.
- Browser
- Download file 612 Bytes
-
https://huggingface.co/spaces/Obotu/mini/resolve/main/app.py
- Command line
-
hf download hf://spaces/Obotu/mini/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Obotu/mini/resolve/main/app.py
612 Bytes
| from transformers import pipeline | |
| # Load the BioBERT model for question answering | |
| qa_pipeline = pipeline('question-answering', model='dmis-lab/biobert-base-cased-v1.1') | |
| # Example question and context | |
| question = "What is the function of the heart?" | |
| context = """ | |
| The heart is a muscular organ in most animals, which pumps blood through the blood vessels of the circulatory system. | |
| The pumped blood carries oxygen and nutrients to the body, while carrying metabolic waste such as carbon dioxide to the lungs. | |
| """ | |
| # Get the answer | |
| result = qa_pipeline(question=question, context=context) | |
| print(result['answer']) | |