Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation, revisited #314

Open
Manamama opened this issue Feb 27, 2023 · 1 comment
Open

Installation, revisited #314

Manamama opened this issue Feb 27, 2023 · 1 comment

Comments

@Manamama
Copy link

Manamama commented Feb 27, 2023

Summary:
Run e.g. this one

sudo docker pull am271/gpt2
sudo docker run --rm -it am271/gpt2 bash
python3 ./download_model.py 345M
python3 src/interactive_conditional_samples.py --model_name 345M

for a properly running version.

Details:
Almost nothing has worked out of the box by now, even the dockers way:
load metadata for docker.io/tensorflow/tensorflow:1.12.0-gpu-py3: ------ failed to solve with frontend dockerfile.v0: failed to create LLB definition: rpc error: code = Unknown desc = failed to parse /home/codespace/.docker/.token_seed: unexpected end of JSON input @6Y3GRwDjtGVo4nAe2
or

#11 0.791   File "/usr/lib/python3.5/typing.py", line 177, in _eval_type
#11 0.791     eval(self.__forward_code__, globalns, localns),
#11 0.791   File "<string>", line 1, in <module>
#11 0.791 AttributeError: module 'os' has no attribute 'PathLike'
------
executor failed running [/bin/sh -c python3 download_model.py 124M]: exit code: 1

and such, partially resolvable via a docker builders purge plus:
rm ~/.docker/.token_seed.loc
rm ~/.docker/.token_seed
but then:

#11 0.782   File "/usr/lib/python3.5/typing.py", line 177, in _eval_type
#11 0.782     eval(self.__forward_code__, globalns, localns),
#11 0.782   File "<string>", line 1, in <module>
#11 0.782 AttributeError: module 'os' has no attribute 'PathLike'
------
executor failed running [/bin/sh -c python3 download_model.py 124M]: exit code: 1

The tensorflow "dll hell" got worse since then, obviously.
Only this below has worked for me so far, so pro memoriam:

# Clone the GPT-2 repository from GitHub
git clone https://github.com/openai/gpt-2.git
conda init 
bash
conda create --name gpt2 python=3.6

etc. to intialize it and then:

#!/bin/bash

# Create conda environment with Python 3.6


# Activate the conda environment
conda activate gpt2
#or source activate gpt2


# Navigate to the cloned repository
cd gpt-2/

# Install required Python packages
pip install -r requirements.txt

# Install TensorFlow and NumPy packages with specific versions
pip install tensorflow==1.15.2 numpy==1.18.0
pip install requests
pip install fire
pip install regex
# Download the 345M model
python3 ./download_model.py 345M

# Run the interactive console with the 345M model
python3 src/interactive_conditional_samples.py --model_name 345M

and then get out:
conda deactivate
Interestingly, it is OpenAI ChatGPT plus Bing Chat , the daughers of this one, who has helped me troubleshoot these.

The Github Spaces box where mine runs, another fyi:

~/Downloads/gpt-2 (master) $ neofetch

OS: Ubuntu 20.04.5 LTS x86_64
Kernel: 5.4.0-1103-azure
CPU: Intel Xeon Platinum 8272CL (4) @ 2.5GHz
Memory: 2019MiB / 7957MiB
Shell: /bin/bash 5.0.17
Python: 3.10.4

Uptime: 1 day, 1 hour, 41 mins
Packages: 844 (dpkg)
Terminal: /dev/pts/0

CPU Usage: 2%
Disk (/): 17G / 31G (59%)

Host: Virtual Machine 7.0
Public IP: 20.105.169.104

Ver. 1.0.1

@yingqianch
Copy link

Thank you very much. Sloved my problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants