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

POST /method/generate HTTP/1.1" 401 Unauthorized #5

Open
MrRobot1005 opened this issue Apr 29, 2024 · 1 comment
Open

POST /method/generate HTTP/1.1" 401 Unauthorized #5

MrRobot1005 opened this issue Apr 29, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@MrRobot1005
Copy link

Describe the bug

A clear and concise description of what the bug is.
While mining the output show mostly
POST /method/generate HTTP/1.1" 401 Unauthorized
but some are OK

INFO: 5.161.229.89:58430 - "POST /method/generate HTTP/1.1" 401 Unauthorized
INFO: 66.226.79.190:55422 - "POST /method/generate HTTP/1.1" 500 Internal Server Error
INFO: 75.157.35.90:52164 - "POST /method/generate HTTP/1.1" 401 Unauthorized
INFO: 66.226.79.190:47128 - "POST /method/generate HTTP/1.1" 200 OK
INFO: 5.161.229.89:42924 - "POST /method/generate HTTP/1.1" 401 Unauthorized
INFO: 66.226.79.190:54406 - "POST /method/generate HTTP/1.1" 200 OK
INFO: 66.226.79.190:35560 - "POST /method/generate HTTP/1.1" 200 OK
INFO: 146.190.31.190:45302 - "POST /method/generate HTTP/1.1" 401 Unauthorized
INFO: 75.119.130.214:40602 - "POST /method/generate HTTP/1.1" 401 Unauthorized
INFO: 5.161.229.89:47316 - "POST /method/generate HTTP/1.1" 401 Unauthorized
INFO: 5.161.229.89:47322 - "POST /method/generate HTTP/1.1" 401 Unauthorized
INFO: 185.241.151.222:34466 - "POST /method/generate HTTP/1.1" 401 Unauthorized
INFO: 66.226.79.190:37752 - "POST /method/generate HTTP/1.1" 500 Internal Server Error
INFO: 75.157.35.90:52124 - "POST /method/generate HTTP/1.1" 401 Unauthorized
INFO: 66.226.79.190:46622 - "POST /method/generate HTTP/1.1" 200 OK
INFO: 5.161.229.89:42624 - "POST /method/generate HTTP/1.1" 401 Unauthorized
INFO: 66.226.79.190:47842 - "POST /method/generate HTTP/1.1" 200 OK
INFO: 66.226.79.190:49926 - "POST /method/generate HTTP/1.1" 200 OK
INFO: 5.161.229.89:58962 - "POST /method/generate HTTP/1.1" 401 Unauthorized
INFO: 66.226.79.190:38288 - "POST /method/generate HTTP/1.1" 500 Internal Server Error
INFO: 75.157.35.90:52162 - "POST /method/generate HTTP/1.1" 401 Unauthorized
INFO: 5.161.229.89:49000 - "POST /method/generate HTTP/1.1" 401 Unauthorized
INFO: 146.190.31.190:44676 - "POST /method/generate HTTP/1.1" 401 Unauthorized
INFO: 5.161.229.89:57928 - "POST /method/generate HTTP/1.1" 401 Unauthorized
INFO: 75.119.130.214:44752 - "POST /method/generate HTTP/1.1" 401 Unauthorized
INFO: 66.226.79.190:41700 - "POST /method/generate HTTP/1.1" 200 OK

To Reproduce

Start the miner

Steps to reproduce the behavior

comx module serve synthia.miner.anthropic.AnthropicModule Frank1 --subnets-whitelist 3 --ip 0.0.0.0

Expected behavior

Miner should report:
POST /method/generate HTTP/1.1" 200 OK

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Specs

  • OS: Ubuntu 24.04
  • Package Version: [e.g. 0.1.2]
  • Python Version: Python 3.12.3

Additional context

Add any other context about the problem here.

Installation steps:
apt-get update
apt install python3-poetry

apt install python3-pip
apt install pipx

pip install communex --upgrade --break-system-packages
pipx install poetry
pipx ensurepath

git clone https://github.com/agicommies/synthia.git
python3 -m venv .venv
source .venv/bin/activate

Poetry Download

curl -sSL https://install.python-poetry.org | python3 -
echo "PATH=/.local/bin:$PATH" >>/.bashrc
source ~/.bashrc

pip install setuptools wheel gnureadline
Error with gnureadline
/usr/bin/ld: cannot find -lncurses: No such file or directory
collect2: error: ld returned 1 exit status
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for gnureadline
Failed to build gnureadline
ERROR: Could not build wheels for gnureadline, which is required to install pyproject.toml-based projects

but workaround found:
apt-get install libreadline8t64
libreadline8t64 is already the newest version (8.2-4build1)

cd ~/synthia
poetry install
poetry add communex
poetry update package
poetry shell

cat ecosystem.config.js
module.exports = {
apps: [
{
name: ${process.env.MODULE_KEYNAME},
script: 'src/synthia/cli.py',
interpreter: 'python3',
args: process.env.MODULE_PATH, // Using environment variable
watch: true,
env: {
MODULE_ENV: 'development',
MODULE_PATH: ${process.env.MODULE_PATH}, // Default path that can be overridden
}
},
{
name: ${process.env.MODULE_KEYNAME},
script: 'comx',
# shellcheck disable:=SC2162

args: `module serve --ip "${process.env.MODULE_IP}" --port "${process.env.MODULE_PORT}" --subnets-whitelist "${process.env.MODULE_NETUID}" "synthia.miner.${process.env.MODULE_PATH}" "${process.env.MODULE_KEYNAME}"`,
        watch: true,
        env: {
            MODULE_ENV: 'development',
            MODULE_IP: '0.0.0.0', // Default IP
            MODULE_PORT: '8000',    // Default Port
            MODULE_NETUID: '3',   // Default Netuid
            MODULE_PATH: 'anthropic.AnthropicModule',
            MODULE_KEYNAME: 'module',
            MODULE_STAKE: '300'
        }
    }
]

};

cp env/config.env.sample env/config.env

edited env/config.env

last 6 digits here changed to X

ANTHROPIC_API_KEY="sk-ant-api03-_vl1viPRtQ9b1sklLi_kHg2xw-8Wx5AMZXG5Nh0NdgWTbUS06QyhM-B56aLnmbUwl4sawcybhnoA4oBbVL1dyg-i3XXXXXX"
OPENROUTER_API_KEY="sk-proj-GC8UiUsW3jtjBu1Ccc7qT3BlbkFJKWAkLFGFcXUNTWXXXXXX"
# use best claude model
ANTHROPIC_MODEL=claude-3-opus-20240229

keep rather above 500 >

ANTHROPIC_MAX_TOKENS=1000
ANTHROPIC_TEMPERATURE=0.1

== Validator

same anthropic settings as above and also:

for embedding scoring

OPENAI_API_KEY="sk-proj-GC8UiUsW3jtjBu1Ccc7qT3BlbkFJKWAkLFGFcXUNTWXXXXXX"

start miner:
cd ~/synthia
comx module register --ip 37.27.89.12 --port 8000 --netuid 3
comx key create
nohup comx module serve synthia.miner.anthropic.AnthropicModule --subnets-whitelist 3 --ip 0.0.0.0 &

also tried with export environment variables as shown in config.env with preset export in .bashrc

@MrRobot1005 MrRobot1005 added the bug Something isn't working label Apr 29, 2024
@Marc1510BVB
Copy link

Solution:
cd ~/synthia
git clone https://github.com/agicommies/synthia.git
poetry update communex
Updating communex (0.1.19 -> 0.1.21)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants