master
/ Untitled.ipynb

Untitled.ipynb @3c11360view markup · raw · history · blame

Notebook
In [2]:
pip show torch
Name: torch
Version: 1.10.0+cu102
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org/
Author: PyTorch Team
Author-email: packages@pytorch.org
License: BSD-3
Location: /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages
Requires: typing-extensions
Required-by: timm, torchvision, torchtext, torchaudio, pytorch-transformers, pytorch-pretrained-bert, fairscale
Note: you may need to restart the kernel to use updated packages.
In [6]:
pip show transformers
Name: transformers
Version: 4.15.0
Summary: State-of-the-art Natural Language Processing for TensorFlow 2.0 and PyTorch
Home-page: https://github.com/huggingface/transformers
Author: Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Sam Shleifer, Patrick von Platen, Sylvain Gugger, Suraj Patil, Stas Bekman, Google AI Language Team Authors, Open AI team Authors, Facebook AI Authors, Carnegie Mellon University Authors
Author-email: thomas@huggingface.co
License: Apache
Location: /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages
Requires: packaging, numpy, requests, pyyaml, filelock, huggingface-hub, importlib-metadata, sacremoses, tokenizers, tqdm, regex
Required-by: 
Note: you may need to restart the kernel to use updated packages.
In [4]:
from handler import handle
conf = {'Photo': './img/demo.jpg', 'Question': 'What is in this image?'}
ans = handle(conf)
print(ans)
Runned time: 559.334 s
{'Answer': 'woman and dog'}