mirror of
https://github.com/open-compass/opencompass.git
synced 2025-05-30 16:03:24 +08:00
New logo and update setup.py
This commit is contained in:
parent
d3b6112b2b
commit
dcf11cf8fd
28
configs/eval_demo.py
Normal file
28
configs/eval_demo.py
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
from opencompass.models import HuggingFaceCausalLM
|
||||||
|
|
||||||
|
with read_base():
|
||||||
|
from .datasets.piqa.piqa_ppl import piqa_datasets
|
||||||
|
|
||||||
|
datasets = piqa_datasets
|
||||||
|
|
||||||
|
models = [
|
||||||
|
# OPT-1.3b
|
||||||
|
dict(
|
||||||
|
type=HuggingFaceCausalLM,
|
||||||
|
path='facebook/opt-1.3b',
|
||||||
|
tokenizer_path='facebook/opt-1.3b',
|
||||||
|
tokenizer_kwargs=dict(
|
||||||
|
padding_side='left',
|
||||||
|
truncation_side='left',
|
||||||
|
proxies=None,
|
||||||
|
trust_remote_code=True,
|
||||||
|
),
|
||||||
|
max_out_len=100,
|
||||||
|
max_seq_len=2048,
|
||||||
|
batch_size=16,
|
||||||
|
model_kwargs=dict(device_map='auto'),
|
||||||
|
run_cfg=dict(num_gpus=1, num_procs=1),
|
||||||
|
)
|
||||||
|
]
|
||||||
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
|||||||
.header-logo {
|
.header-logo {
|
||||||
background-image: url("../image/logo.png");
|
background-image: url("../image/logo.svg");
|
||||||
background-size: 183px 50px;
|
background-size: 275px 80px;
|
||||||
height: 50px;
|
height: 80px;
|
||||||
width: 183px;
|
width: 275px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (min-width: 1100px) {
|
@media screen and (min-width: 1100px) {
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 12 KiB |
30
docs/en/_static/image/logo.svg
Normal file
30
docs/en/_static/image/logo.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 14 KiB |
@ -17,7 +17,6 @@ conda install pytorch torchvision -c pytorch
|
|||||||
```bash
|
```bash
|
||||||
git clone https://github.com/opencompass/opencompass
|
git clone https://github.com/opencompass/opencompass
|
||||||
cd opencompass
|
cd opencompass
|
||||||
pip install -r requirments/runtime.txt
|
|
||||||
pip install -e .
|
pip install -e .
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
.header-logo {
|
.header-logo {
|
||||||
background-image: url("../image/logo.png");
|
background-image: url("../image/logo.svg");
|
||||||
background-size: 183px 50px;
|
background-size: 275px 80px;
|
||||||
height: 50px;
|
height: 80px;
|
||||||
width: 183px;
|
width: 275px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (min-width: 1100px) {
|
@media screen and (min-width: 1100px) {
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 12 KiB |
30
docs/zh_cn/_static/image/logo.svg
Normal file
30
docs/zh_cn/_static/image/logo.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 14 KiB |
@ -17,7 +17,6 @@ conda install pytorch torchvision -c pytorch
|
|||||||
```bash
|
```bash
|
||||||
git clone https://github.com/opencompass/opencompass
|
git clone https://github.com/opencompass/opencompass
|
||||||
cd opencompass
|
cd opencompass
|
||||||
pip install -r requirments/runtime.txt
|
|
||||||
pip install -e .
|
pip install -e .
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
__version__ = '0.1.0'
|
4
run.py
4
run.py
@ -214,7 +214,7 @@ def exec_infer_runner(tasks, args, cfg):
|
|||||||
else:
|
else:
|
||||||
runner = LocalRunner(
|
runner = LocalRunner(
|
||||||
task=dict(type='OpenICLInferTask'),
|
task=dict(type='OpenICLInferTask'),
|
||||||
# max_num_workers = args.max_num_workers,
|
max_num_workers = args.max_num_workers,
|
||||||
debug=args.debug,
|
debug=args.debug,
|
||||||
lark_bot_url=cfg['lark_bot_url'])
|
lark_bot_url=cfg['lark_bot_url'])
|
||||||
runner(tasks)
|
runner(tasks)
|
||||||
@ -240,7 +240,7 @@ def exec_eval_runner(tasks, args, cfg):
|
|||||||
else:
|
else:
|
||||||
runner = LocalRunner(
|
runner = LocalRunner(
|
||||||
task=dict(type='OpenICLEvalTask'),
|
task=dict(type='OpenICLEvalTask'),
|
||||||
# max_num_workers = args.max_num_workers,
|
max_num_workers = args.max_num_workers,
|
||||||
debug=args.debug,
|
debug=args.debug,
|
||||||
lark_bot_url=cfg['lark_bot_url'])
|
lark_bot_url=cfg['lark_bot_url'])
|
||||||
runner(tasks)
|
runner(tasks)
|
||||||
|
88
setup.py
88
setup.py
@ -10,14 +10,97 @@ class DownloadNLTK(install):
|
|||||||
nltk.download('punkt')
|
nltk.download('punkt')
|
||||||
|
|
||||||
|
|
||||||
with open('README.md') as f:
|
with open('README_zh-CN.md') as f:
|
||||||
readme = f.read()
|
readme = f.read()
|
||||||
|
|
||||||
|
def parse_requirements(fname='requirements.txt', with_version=True):
|
||||||
|
"""Parse the package dependencies listed in a requirements file but strips
|
||||||
|
specific versioning information.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
fname (str): path to requirements file
|
||||||
|
with_version (bool, default=False): if True include version specs
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
List[str]: list of requirements items
|
||||||
|
|
||||||
|
CommandLine:
|
||||||
|
python -c "import setup; print(setup.parse_requirements())"
|
||||||
|
"""
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from os.path import exists
|
||||||
|
require_fpath = fname
|
||||||
|
|
||||||
|
def parse_line(line):
|
||||||
|
"""Parse information from a line in a requirements text file."""
|
||||||
|
if line.startswith('-r '):
|
||||||
|
# Allow specifying requirements in other files
|
||||||
|
target = line.split(' ')[1]
|
||||||
|
for info in parse_require_file(target):
|
||||||
|
yield info
|
||||||
|
else:
|
||||||
|
info = {'line': line}
|
||||||
|
if line.startswith('-e '):
|
||||||
|
info['package'] = line.split('#egg=')[1]
|
||||||
|
else:
|
||||||
|
# Remove versioning from the package
|
||||||
|
pat = '(' + '|'.join(['>=', '==', '>']) + ')'
|
||||||
|
parts = re.split(pat, line, maxsplit=1)
|
||||||
|
parts = [p.strip() for p in parts]
|
||||||
|
|
||||||
|
info['package'] = parts[0]
|
||||||
|
if len(parts) > 1:
|
||||||
|
op, rest = parts[1:]
|
||||||
|
if ';' in rest:
|
||||||
|
# Handle platform specific dependencies
|
||||||
|
# http://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-platform-specific-dependencies
|
||||||
|
version, platform_deps = map(str.strip,
|
||||||
|
rest.split(';'))
|
||||||
|
info['platform_deps'] = platform_deps
|
||||||
|
else:
|
||||||
|
version = rest # NOQA
|
||||||
|
if '--' in version:
|
||||||
|
# the `extras_require` doesn't accept options.
|
||||||
|
version = version.split('--')[0].strip()
|
||||||
|
info['version'] = (op, version)
|
||||||
|
yield info
|
||||||
|
|
||||||
|
def parse_require_file(fpath):
|
||||||
|
with open(fpath, 'r') as f:
|
||||||
|
for line in f.readlines():
|
||||||
|
line = line.strip()
|
||||||
|
if line and not line.startswith('#'):
|
||||||
|
for info in parse_line(line):
|
||||||
|
yield info
|
||||||
|
|
||||||
|
def gen_packages_items():
|
||||||
|
if exists(require_fpath):
|
||||||
|
for info in parse_require_file(require_fpath):
|
||||||
|
parts = [info['package']]
|
||||||
|
if with_version and 'version' in info:
|
||||||
|
parts.extend(info['version'])
|
||||||
|
if not sys.version.startswith('3.4'):
|
||||||
|
# apparently package_deps are broken in 3.4
|
||||||
|
platform_deps = info.get('platform_deps')
|
||||||
|
if platform_deps is not None:
|
||||||
|
parts.append(';' + platform_deps)
|
||||||
|
item = ''.join(parts)
|
||||||
|
yield item
|
||||||
|
|
||||||
|
packages = list(gen_packages_items())
|
||||||
|
return packages
|
||||||
|
|
||||||
|
def get_version():
|
||||||
|
version_file = 'opencompass/__init__.py'
|
||||||
|
with open(version_file, 'r', encoding='utf-8') as f:
|
||||||
|
exec(compile(f.read(), version_file, 'exec'))
|
||||||
|
return locals()['__version__']
|
||||||
|
|
||||||
def do_setup():
|
def do_setup():
|
||||||
setup(
|
setup(
|
||||||
name='opencompass',
|
name='opencompass',
|
||||||
version='0.5.0',
|
version=get_version(),
|
||||||
description='A comprehensive toolkit for large model evaluation',
|
description='A comprehensive toolkit for large model evaluation',
|
||||||
# url="",
|
# url="",
|
||||||
# author="",
|
# author="",
|
||||||
@ -26,6 +109,7 @@ def do_setup():
|
|||||||
cmdclass={'download_nltk': DownloadNLTK},
|
cmdclass={'download_nltk': DownloadNLTK},
|
||||||
setup_requires=['nltk==3.8'],
|
setup_requires=['nltk==3.8'],
|
||||||
python_requires='>=3.8.0',
|
python_requires='>=3.8.0',
|
||||||
|
install_requires=parse_requirements('requirements/runtime.txt'),
|
||||||
packages=find_packages(exclude=[
|
packages=find_packages(exclude=[
|
||||||
'test*',
|
'test*',
|
||||||
'paper_test*',
|
'paper_test*',
|
||||||
|
Loading…
Reference in New Issue
Block a user