webdemo openxlab

This commit is contained in:
006861 2024-07-15 23:32:52 +08:00
parent e8b2e69393
commit 7592104dbc

View File

@ -15,7 +15,7 @@ Please run with the command `streamlit run path/to/web_demo.py
Using `python path/to/web_demo.py` may cause unknown problems. Using `python path/to/web_demo.py` may cause unknown problems.
""" """
# isort: skip_file # isort: skip_file
import copy import copy, os
import warnings import warnings
from dataclasses import asdict, dataclass from dataclasses import asdict, dataclass
from typing import Callable, List, Optional from typing import Callable, List, Optional
@ -31,10 +31,15 @@ from transformers import AutoTokenizer, AutoModelForCausalLM # isort: skip
logger = logging.get_logger(__name__) logger = logging.get_logger(__name__)
# local # # local
model_path = '/root/EmoLLM/xtuner_config/hf4' # model_path = '/root/EmoLLM/xtuner_config/hf_safe'
# Online downloading will be added later # Online downloading will be added later
model_path = './EmoLLM_V3.0'
os.system(f'git clone https://code.openxlab.org.cn/chg0901/EmoLLM_V3.0.git {model_path}')
os.system(f'cd {model_path} && git lfs pull')
@dataclass @dataclass
class GenerationConfig: class GenerationConfig:
# this config is used for chat to provide more diversity # this config is used for chat to provide more diversity