Merge 805363d928 into a1d071733d
This commit is contained in:
commit
383252fa41
|
|
@ -28,6 +28,5 @@ jobs:
|
||||||
- run: conda install -n test python=${{ matrix.python-version }} pytorch=${{ matrix.pytorch-version }} torchvision=${{ matrix.torchvision-version }} cpuonly -c pytorch
|
- run: conda install -n test python=${{ matrix.python-version }} pytorch=${{ matrix.pytorch-version }} torchvision=${{ matrix.torchvision-version }} cpuonly -c pytorch
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- run: echo "$CONDA/envs/test/bin" >> $GITHUB_PATH
|
- run: echo "$CONDA/envs/test/bin" >> $GITHUB_PATH
|
||||||
- run: pip install pytest
|
- run: pip install .[dev]
|
||||||
- run: pip install .
|
|
||||||
- run: pytest
|
- run: pytest
|
||||||
|
|
|
||||||
|
|
@ -8,3 +8,5 @@ __pycache__/
|
||||||
thumbs.db
|
thumbs.db
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.idea
|
.idea
|
||||||
|
|
||||||
|
build
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
# Changelog
|
||||||
|
|
||||||
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||||
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- pyproject.toml
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Start using "pyproject.toml" over "setup.py" to manage the package information.
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
|
||||||
|
- requirements.txt
|
||||||
|
- setup.py
|
||||||
|
|
@ -14,16 +14,12 @@ CLIP (Contrastive Language-Image Pre-Training) is a neural network trained on a
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
First, [install PyTorch 1.7.1](https://pytorch.org/get-started/locally/) (or later) and torchvision, as well as small additional dependencies, and then install this repo as a Python package. On a CUDA GPU machine, the following will do the trick:
|
First, install this repo as a Python package
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ conda install --yes -c pytorch pytorch=1.7.1 torchvision cudatoolkit=11.0
|
|
||||||
$ pip install ftfy regex tqdm
|
|
||||||
$ pip install git+https://github.com/openai/CLIP.git
|
$ pip install git+https://github.com/openai/CLIP.git
|
||||||
```
|
```
|
||||||
|
|
||||||
Replace `cudatoolkit=11.0` above with the appropriate CUDA version on your machine or `cpuonly` when installing on a machine without a GPU.
|
|
||||||
|
|
||||||
```python
|
```python
|
||||||
import torch
|
import torch
|
||||||
import clip
|
import clip
|
||||||
|
|
|
||||||
|
|
@ -1 +1,3 @@
|
||||||
from .clip import *
|
from .clip import *
|
||||||
|
|
||||||
|
__version__ = "1.1.dev"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
[build-system]
|
||||||
|
requires = ["setuptools"]
|
||||||
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
|
[project]
|
||||||
|
name = "clip"
|
||||||
|
dynamic = ["version", "readme"]
|
||||||
|
authors = [{name = "OpenAI"}]
|
||||||
|
requires-python = ">=3.8"
|
||||||
|
dependencies = [
|
||||||
|
"ftfy",
|
||||||
|
"regex",
|
||||||
|
"tqdm",
|
||||||
|
"torch>=1.7.1",
|
||||||
|
"torchvision",
|
||||||
|
]
|
||||||
|
|
||||||
|
[project.optional-dependencies]
|
||||||
|
dev = ["pytest"]
|
||||||
|
|
||||||
|
[tool.setuptools.dynamic]
|
||||||
|
version = {attr = "clip.__version__"}
|
||||||
|
readme = {file = ["README.md"]}
|
||||||
|
|
||||||
|
[tool.setuptools.packages.find]
|
||||||
|
exclude = ["tests"]
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
ftfy
|
|
||||||
regex
|
|
||||||
tqdm
|
|
||||||
torch
|
|
||||||
torchvision
|
|
||||||
21
setup.py
21
setup.py
|
|
@ -1,21 +0,0 @@
|
||||||
import os
|
|
||||||
|
|
||||||
import pkg_resources
|
|
||||||
from setuptools import setup, find_packages
|
|
||||||
|
|
||||||
setup(
|
|
||||||
name="clip",
|
|
||||||
py_modules=["clip"],
|
|
||||||
version="1.0",
|
|
||||||
description="",
|
|
||||||
author="OpenAI",
|
|
||||||
packages=find_packages(exclude=["tests*"]),
|
|
||||||
install_requires=[
|
|
||||||
str(r)
|
|
||||||
for r in pkg_resources.parse_requirements(
|
|
||||||
open(os.path.join(os.path.dirname(__file__), "requirements.txt"))
|
|
||||||
)
|
|
||||||
],
|
|
||||||
include_package_data=True,
|
|
||||||
extras_require={'dev': ['pytest']},
|
|
||||||
)
|
|
||||||
Loading…
Reference in New Issue