{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"id": "3fe9c537",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Name: torch\n",
"Version: 1.10.0+cu102\n",
"Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration\n",
"Home-page: https://pytorch.org/\n",
"Author: PyTorch Team\n",
"Author-email: packages@pytorch.org\n",
"License: BSD-3\n",
"Location: /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages\n",
"Requires: typing-extensions\n",
"Required-by: timm, torchvision, torchtext, torchaudio, pytorch-transformers, pytorch-pretrained-bert, fairscale\n",
"Note: you may need to restart the kernel to use updated packages.\n"
]
}
],
"source": [
"pip show torch"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "ef511ab0",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Name: transformers\n",
"Version: 4.15.0\n",
"Summary: State-of-the-art Natural Language Processing for TensorFlow 2.0 and PyTorch\n",
"Home-page: https://github.com/huggingface/transformers\n",
"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\n",
"Author-email: thomas@huggingface.co\n",
"License: Apache\n",
"Location: /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages\n",
"Requires: packaging, numpy, requests, pyyaml, filelock, huggingface-hub, importlib-metadata, sacremoses, tokenizers, tqdm, regex\n",
"Required-by: \n",
"Note: you may need to restart the kernel to use updated packages.\n"
]
}
],
"source": [
"pip show transformers"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "9da7783e",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Runned time: 559.334 s\n",
"{'Answer': 'woman and dog'}\n"
]
}
],
"source": [
"from handler import handle\n",
"conf = {'Photo': './img/demo.jpg', 'Question': 'What is in this image?'}\n",
"ans = handle(conf)\n",
"print(ans)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.5"
}
},
"nbformat": 4,
"nbformat_minor": 5
}