diff --git a/Jiayi_GPT2_v2.ipynb b/Jiayi_GPT2_v2.ipynb index 0008dd3..110404f 100644 --- a/Jiayi_GPT2_v2.ipynb +++ b/Jiayi_GPT2_v2.ipynb @@ -412,9 +412,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "写一首唐诗:一\n", + "写一首唐诗:一江春水碧,见\n", + "写一首唐诗:一江春水碧,见我岸边白。如\n", + "写一首唐诗:一江春水碧,见我岸边白。如今长绿碧,故\n", + "写一首唐诗:一江春水碧,见我岸边白。如今长绿碧,故园有香火。\n", + "一江春水碧,见我岸边白。如今长绿碧,故园有香火。\n" + ] + } + ], "source": [ "from transformers import AutoTokenizer, AutoModelForCausalLM, StoppingCriteria\n", "from peft import PeftModel\n", @@ -494,49 +507,11 @@ " res = cang_tou(prompt)\n", " if conf['mode']==\"根据提示生成古诗\":\n", " res = prompt_gen(prompt)\n", - " return {\"result\": res}" + " return {\"result\": res}\n", + "\n", + "res = cang_tou(\"一见如故\")\n", + "print(res)" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "input:\n", - " 'prompt':\n", - " default: 写一首关于思乡的古诗/一见如故\n", - " description: 输入古诗的风格或藏头内容\n", - " name: prompt\n", - " range: null\n", - " value_type: \"str\"\n", - " 'mode':\n", - " # default: '藏头诗'\n", - " description: 选择生成方式\n", - " value_range: [\"根据提示生成古诗\", \"藏头诗\"]\n", - " optional: true\n", - " value_type: \"str\"\n", - "output:\n", - " 'result':\n", - " value_type: \"str\"\n", - " description: 生成的古诗" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "rKlweyOjVBct" - }, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { diff --git a/job_logs/job-cpu-64b67a5088be129fabeb2232.log b/job_logs/job-cpu-64b67a5088be129fabeb2232.log deleted file mode 100644 index d6be5f2..0000000 --- a/job_logs/job-cpu-64b67a5088be129fabeb2232.log +++ /dev/null @@ -1,81 +0,0 @@ -2023-07-18T11:41:55.03360851Z SYSTEM: Preparing env... -2023-07-18T11:41:55.726690944Z SYSTEM: Running... -2023-07-18T11:42:25.320648958Z \ No newline at end of file -Downloading (…)lve/main/config.json: 0% 0.00/783 [00:00", line 3, in raise_from -2023-07-18T11:42:37.17516118Z File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 444, in _make_request -2023-07-18T11:42:37.175612052Z httplib_response = conn.getresponse() -2023-07-18T11:42:37.175633444Z File "/usr/lib/python3.7/http/client.py", line 1348, in getresponse -2023-07-18T11:42:37.185176023Z response.begin() -2023-07-18T11:42:37.185204343Z File "/usr/lib/python3.7/http/client.py", line 315, in begin -2023-07-18T11:42:37.185329744Z version, status, reason = self._read_status() -2023-07-18T11:42:37.185345799Z File "/usr/lib/python3.7/http/client.py", line 276, in _read_status -2023-07-18T11:42:37.185466204Z line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") -2023-07-18T11:42:37.185477979Z File "/usr/lib/python3.7/socket.py", line 589, in readinto -2023-07-18T11:42:37.193210634Z return self._sock.recv_into(b) -2023-07-18T11:42:37.193221616Z File "/usr/lib/python3.7/ssl.py", line 1071, in recv_into -2023-07-18T11:42:37.193835046Z return self.read(nbytes, buffer) -2023-07-18T11:42:37.193850305Z File "/usr/lib/python3.7/ssl.py", line 929, in read -2023-07-18T11:42:37.194070955Z return self._sslobj.read(len, buffer) -2023-07-18T11:42:37.194141797Z socket.timeout: The read operation timed out -2023-07-18T11:42:37.194152332Z -2023-07-18T11:42:37.194160153Z During handling of the above exception, another exception occurred: -2023-07-18T11:42:37.194168302Z -2023-07-18T11:42:37.194175856Z Traceback (most recent call last): -2023-07-18T11:42:37.194183776Z File "/usr/local/lib/python3.7/dist-packages/requests/adapters.py", line 499, in send -2023-07-18T11:42:37.199311187Z timeout=timeout, -2023-07-18T11:42:37.199320047Z File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 788, in urlopen -2023-07-18T11:42:37.199517787Z method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2] -2023-07-18T11:42:37.19953011Z File "/usr/local/lib/python3.7/dist-packages/urllib3/util/retry.py", line 550, in increment -2023-07-18T11:42:37.208092065Z raise six.reraise(type(error), error, _stacktrace) -2023-07-18T11:42:37.208101472Z File "/usr/local/lib/python3.7/dist-packages/urllib3/packages/six.py", line 770, in reraise -2023-07-18T11:42:37.214637273Z raise value -2023-07-18T11:42:37.214648226Z File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 710, in urlopen -2023-07-18T11:42:37.214817367Z chunked=chunked, -2023-07-18T11:42:37.214825201Z File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 451, in _make_request -2023-07-18T11:42:37.214951376Z self._raise_timeout(err=e, url=url, timeout_value=read_timeout) -2023-07-18T11:42:37.214961263Z File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 341, in _raise_timeout -2023-07-18T11:42:37.215081164Z self, url, "Read timed out. (read timeout=%s)" % timeout_value -2023-07-18T11:42:37.215149864Z urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='huggingface.co', port=443): Read timed out. (read timeout=10.0) -2023-07-18T11:42:37.215159464Z -2023-07-18T11:42:37.215167915Z During handling of the above exception, another exception occurred: -2023-07-18T11:42:37.215174499Z -2023-07-18T11:42:37.215180938Z Traceback (most recent call last): -2023-07-18T11:42:37.215187299Z File "Jiayi_GPT2_v2.py", line 34, in -2023-07-18T11:42:37.215316124Z tokenizer = AutoTokenizer.from_pretrained("IDEA-CCNL/Wenzhong-GPT2-110M") -2023-07-18T11:42:37.215326652Z File "/home/jovyan/work/.localenv/lib/python3.7/site-packages/transformers/models/auto/tokenization_auto.py", line 691, in from_pretrained -2023-07-18T11:42:37.218173363Z return tokenizer_class.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs) -2023-07-18T11:42:37.218182646Z File "/home/jovyan/work/.localenv/lib/python3.7/site-packages/transformers/tokenization_utils_base.py", line 1798, in from_pretrained -2023-07-18T11:42:37.219384746Z _commit_hash=commit_hash, -2023-07-18T11:42:37.219394704Z File "/home/jovyan/work/.localenv/lib/python3.7/site-packages/transformers/utils/hub.py", line 429, in cached_file -2023-07-18T11:42:37.220399143Z local_files_only=local_files_only, -2023-07-18T11:42:37.220418475Z File "/home/jovyan/work/.localenv/lib/python3.7/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn -2023-07-18T11:42:37.222225134Z return fn(*args, **kwargs) -2023-07-18T11:42:37.222235063Z File "/home/jovyan/work/.localenv/lib/python3.7/site-packages/huggingface_hub/file_download.py", line 1370, in hf_hub_download -2023-07-18T11:42:37.223073484Z expected_size=expected_size, -2023-07-18T11:42:37.223095271Z File "/home/jovyan/work/.localenv/lib/python3.7/site-packages/huggingface_hub/file_download.py", line 512, in http_get -2023-07-18T11:42:37.223262685Z max_retries=max_retries, -2023-07-18T11:42:37.223273156Z File "/home/jovyan/work/.localenv/lib/python3.7/site-packages/huggingface_hub/file_download.py", line 451, in _request_wrapper -2023-07-18T11:42:37.223415047Z **params, -2023-07-18T11:42:37.223426282Z File "/home/jovyan/work/.localenv/lib/python3.7/site-packages/huggingface_hub/utils/_http.py", line 274, in http_backoff -2023-07-18T11:42:37.223533993Z raise err -2023-07-18T11:42:37.223543613Z File "/home/jovyan/work/.localenv/lib/python3.7/site-packages/huggingface_hub/utils/_http.py", line 258, in http_backoff -2023-07-18T11:42:37.223648183Z response = session.request(method=method, url=url, **kwargs) -2023-07-18T11:42:37.223659795Z File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 587, in request -2023-07-18T11:42:37.223924881Z resp = self.send(prep, **send_kwargs) -2023-07-18T11:42:37.22393482Z File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 701, in send -2023-07-18T11:42:37.224113187Z r = adapter.send(request, **kwargs) -2023-07-18T11:42:37.224124714Z File "/home/jovyan/work/.localenv/lib/python3.7/site-packages/huggingface_hub/utils/_http.py", line 63, in send -2023-07-18T11:42:37.224192739Z return super().send(request, *args, **kwargs) -2023-07-18T11:42:37.224202591Z File "/usr/local/lib/python3.7/dist-packages/requests/adapters.py", line 578, in send -2023-07-18T11:42:37.224357066Z raise ReadTimeout(e, request=request) -2023-07-18T11:42:37.224368877Z requests.exceptions.ReadTimeout: (ReadTimeoutError("HTTPSConnectionPool(host='huggingface.co', port=443): Read timed out. (read timeout=10.0)"), '(Request ID: 0aa11e85-1c91-4165-9fa6-aefd8fdb628e)') -2023-07-18T11:42:37.716441329Z SYSTEM: Finishing... diff --git a/job_logs/job-gpu-64b6729c71e4f5354cbee882.log b/job_logs/job-gpu-64b6729c71e4f5354cbee882.log deleted file mode 100644 index deb285a..0000000 --- a/job_logs/job-gpu-64b6729c71e4f5354cbee882.log +++ /dev/null @@ -1,27 +0,0 @@ -2023-07-18T11:09:23.915461467Z SYSTEM: Preparing env... -2023-07-18T11:09:24.764525329Z SYSTEM: Running... -2023-07-18T11:09:45.44876355Z \ No newline at end of file -Downloading (…)okenizer_config.json: 0% 0.00/236 [00:00 -2023-07-18T11:09:51.918070472Z train_dataset = PoemDataset("data/train_poems_v2.txt") -2023-07-18T11:09:51.918101846Z File "poem_generate.py", line 38, in __init__ -2023-07-18T11:09:51.918413442Z self.poems = open(path, encoding='utf-8').readlines() # [:30000] -2023-07-18T11:09:51.918425211Z FileNotFoundError: [Errno 2] No such file or directory: 'data/train_poems_v2.txt' -2023-07-18T11:09:52.345900901Z SYSTEM: Finishing... diff --git a/job_logs/job-gpu-64b673eef69fcc06b00358c0.log b/job_logs/job-gpu-64b673eef69fcc06b00358c0.log deleted file mode 100644 index 1e89903..0000000 --- a/job_logs/job-gpu-64b673eef69fcc06b00358c0.log +++ /dev/null @@ -1,30 +0,0 @@ -2023-07-18T11:14:31.458571447Z SYSTEM: Preparing env... -2023-07-18T11:14:32.03489076Z SYSTEM: Running... -2023-07-18T11:15:15.428924512Z '(ReadTimeoutError("HTTPSConnectionPool(host='huggingface.co', port=443): Read timed out. (read timeout=10)"), '(Request ID: 90fdd5d8-ea54-49f2-b828-0ec58bbf2c15)')' thrown while requesting HEAD https://huggingface.co/IDEA-CCNL/Wenzhong-GPT2-110M/resolve/main/config.json -2023-07-18T11:15:15.429079107Z Traceback (most recent call last): -2023-07-18T11:15:15.429127239Z File "/home/jovyan/work/.localenv/lib/python3.7/site-packages/transformers/utils/hub.py", line 429, in cached_file -2023-07-18T11:15:15.635035914Z local_files_only=local_files_only, -2023-07-18T11:15:15.635092367Z File "/home/jovyan/work/.localenv/lib/python3.7/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn -2023-07-18T11:15:15.635369025Z return fn(*args, **kwargs) -2023-07-18T11:15:15.635413668Z File "/home/jovyan/work/.localenv/lib/python3.7/site-packages/huggingface_hub/file_download.py", line 1292, in hf_hub_download -2023-07-18T11:15:15.636196264Z "Connection error, and we cannot find the requested files in" -2023-07-18T11:15:15.636214008Z huggingface_hub.utils._errors.LocalEntryNotFoundError: Connection error, and we cannot find the requested files in the disk cache. Please try again or make sure your Internet connection is on. -2023-07-18T11:15:15.636218361Z -2023-07-18T11:15:15.636221526Z During handling of the above exception, another exception occurred: -2023-07-18T11:15:15.636224757Z -2023-07-18T11:15:15.636227735Z Traceback (most recent call last): -2023-07-18T11:15:15.636230924Z File "poem_generate.py", line 18, in -2023-07-18T11:15:15.636433845Z tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH) -2023-07-18T11:15:15.636457277Z File "/home/jovyan/work/.localenv/lib/python3.7/site-packages/transformers/models/auto/tokenization_auto.py", line 659, in from_pretrained -2023-07-18T11:15:15.636749174Z pretrained_model_name_or_path, trust_remote_code=trust_remote_code, **kwargs -2023-07-18T11:15:15.636760831Z File "/home/jovyan/work/.localenv/lib/python3.7/site-packages/transformers/models/auto/configuration_auto.py", line 944, in from_pretrained -2023-07-18T11:15:15.637302444Z config_dict, unused_kwargs = PretrainedConfig.get_config_dict(pretrained_model_name_or_path, **kwargs) -2023-07-18T11:15:15.637311848Z File "/home/jovyan/work/.localenv/lib/python3.7/site-packages/transformers/configuration_utils.py", line 574, in get_config_dict -2023-07-18T11:15:15.638207664Z config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, **kwargs) -2023-07-18T11:15:15.638218038Z File "/home/jovyan/work/.localenv/lib/python3.7/site-packages/transformers/configuration_utils.py", line 641, in _get_config_dict -2023-07-18T11:15:15.63857983Z _commit_hash=commit_hash, -2023-07-18T11:15:15.638616084Z File "/home/jovyan/work/.localenv/lib/python3.7/site-packages/transformers/utils/hub.py", line 453, in cached_file -2023-07-18T11:15:15.638934608Z f"We couldn't connect to '{HUGGINGFACE_CO_RESOLVE_ENDPOINT}' to load this file, couldn't find it in the" -2023-07-18T11:15:15.638945085Z OSError: We couldn't connect to 'https://huggingface.co' to load this file, couldn't find it in the cached files and it looks like IDEA-CCNL/Wenzhong-GPT2-110M is not the path to a directory containing a file named config.json. -2023-07-18T11:15:15.638953735Z Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'. -2023-07-18T11:15:16.120634517Z SYSTEM: Finishing... diff --git a/job_logs/job-gpu-64b67b67080871be885f386d.log b/job_logs/job-gpu-64b67b67080871be885f386d.log deleted file mode 100644 index e94b713..0000000 --- a/job_logs/job-gpu-64b67b67080871be885f386d.log +++ /dev/null @@ -1,29 +0,0 @@ -2023-07-18T11:46:28.275751758Z SYSTEM: Preparing env... -2023-07-18T11:46:28.891945164Z SYSTEM: Running... -2023-07-18T11:46:48.682543449Z Traceback (most recent call last): -2023-07-18T11:46:48.682570396Z File "/home/jovyan/work/.localenv/lib/python3.7/site-packages/transformers/utils/hub.py", line 429, in cached_file -2023-07-18T11:46:48.682773139Z local_files_only=local_files_only, -2023-07-18T11:46:48.682796625Z File "/home/jovyan/work/.localenv/lib/python3.7/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn -2023-07-18T11:46:48.682883762Z return fn(*args, **kwargs) -2023-07-18T11:46:48.682889051Z File "/home/jovyan/work/.localenv/lib/python3.7/site-packages/huggingface_hub/file_download.py", line 1292, in hf_hub_download -2023-07-18T11:46:48.68333916Z "Connection error, and we cannot find the requested files in" -2023-07-18T11:46:48.683346783Z huggingface_hub.utils._errors.LocalEntryNotFoundError: Connection error, and we cannot find the requested files in the disk cache. Please try again or make sure your Internet connection is on. -2023-07-18T11:46:48.683382083Z -2023-07-18T11:46:48.683387123Z During handling of the above exception, another exception occurred: -2023-07-18T11:46:48.683401498Z -2023-07-18T11:46:48.683408428Z Traceback (most recent call last): -2023-07-18T11:46:48.683413046Z File "Jiayi_GPT2_v2.py", line 34, in -2023-07-18T11:46:48.683522561Z tokenizer = AutoTokenizer.from_pretrained("IDEA-CCNL/Wenzhong-GPT2-110M") -2023-07-18T11:46:48.68352799Z File "/home/jovyan/work/.localenv/lib/python3.7/site-packages/transformers/models/auto/tokenization_auto.py", line 659, in from_pretrained -2023-07-18T11:46:48.683749424Z pretrained_model_name_or_path, trust_remote_code=trust_remote_code, **kwargs -2023-07-18T11:46:48.683756267Z File "/home/jovyan/work/.localenv/lib/python3.7/site-packages/transformers/models/auto/configuration_auto.py", line 944, in from_pretrained -2023-07-18T11:46:48.684075952Z config_dict, unused_kwargs = PretrainedConfig.get_config_dict(pretrained_model_name_or_path, **kwargs) -2023-07-18T11:46:48.684081296Z File "/home/jovyan/work/.localenv/lib/python3.7/site-packages/transformers/configuration_utils.py", line 574, in get_config_dict -2023-07-18T11:46:48.684959588Z config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, **kwargs) -2023-07-18T11:46:48.684966551Z File "/home/jovyan/work/.localenv/lib/python3.7/site-packages/transformers/configuration_utils.py", line 641, in _get_config_dict -2023-07-18T11:46:48.685153077Z _commit_hash=commit_hash, -2023-07-18T11:46:48.685158278Z File "/home/jovyan/work/.localenv/lib/python3.7/site-packages/transformers/utils/hub.py", line 453, in cached_file -2023-07-18T11:46:48.685347898Z f"We couldn't connect to '{HUGGINGFACE_CO_RESOLVE_ENDPOINT}' to load this file, couldn't find it in the" -2023-07-18T11:46:48.685355178Z OSError: We couldn't connect to 'https://huggingface.co' to load this file, couldn't find it in the cached files and it looks like IDEA-CCNL/Wenzhong-GPT2-110M is not the path to a directory containing a file named config.json. -2023-07-18T11:46:48.685372422Z Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'. -2023-07-18T11:46:49.230022764Z SYSTEM: Finishing...