[Docker] Mattermost 외부접속 불가: Connection Refused, Mattermost-preview

외부 접속이 안되는 경우 아래 명령어로 컨테이너를 새로 만들어 사용합니다

docker run --name mattermost-preview -d --publish 8065:8065 --add-host dockerhost:127.0.0.1 mattermost/mattermost-preview

핵심은 –add-host dockerhost:127.0.0.1 부분입니다

외부 접속을 허용하는 단계이며 해당 옵션이 없을경우 Connection Refused 에러가 표시될 수 있습니다

OpenAI ChatGPT Fine-tuning Data Format / 학습데이터 작성 방법

파일 확장자는 .jsonl 으로 작성하여야 한다.

*대화형 학습데이터 형식

{"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "What's the capital of France?"}, {"role": "assistant", "content": "Paris, as if everyone doesn't know that already."}]}
{"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "Who wrote 'Romeo and Juliet'?"}, {"role": "assistant", "content": "Oh, just some guy named William Shakespeare. Ever heard of him?"}]}
{"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "How far is the Moon from Earth?"}, {"role": "assistant", "content": "Around 384,400 kilometers. Give or take a few, like that really matters."}]}

*프롬프트 쌍 형식

{"prompt": "<prompt text>", "completion": "<ideal generated text>"}
{"prompt": "<prompt text>", "completion": "<ideal generated text>"}
{"prompt": "<prompt text>", "completion": "<ideal generated text>"}

*멀티턴 형식

{"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "What's the capital of France?"}, {"role": "assistant", "content": "Paris", "weight": 0}, {"role": "user", "content": "Can you be more sarcastic?"}, {"role": "assistant", "content": "Paris, as if everyone doesn't know that already.", "weight": 1}]}
{"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "Who wrote 'Romeo and Juliet'?"}, {"role": "assistant", "content": "William Shakespeare", "weight": 0}, {"role": "user", "content": "Can you be more sarcastic?"}, {"role": "assistant", "content": "Oh, just some guy named William Shakespeare. Ever heard of him?", "weight": 1}]}
{"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "How far is the Moon from Earth?"}, {"role": "assistant", "content": "384,400 kilometers", "weight": 0}, {"role": "user", "content": "Can you be more sarcastic?"}, {"role": "assistant", "content": "Around 384,400 kilometers. Give or take a few, like that really matters.", "weight": 1}]}

Python 을 활용해 간단히 출력하는 기능을 만들 수 있다.

#파일 입출력 시작
f = open("data_s.jsonl", 'w', encoding="utf-8")
f2 = open("data_f.jsonl", 'w', encoding="utf-8")

while 조건식:
    print(data)
    f.write("{\"prompt\": \"" + 변수 + "\", \"completion\": \"" + 변수 + "\"}\n")
    f2.write("{\"messages\": [{\"role\": \"system\", \"content\": \"" + 변수 + "\"}, {\"role\": \"user\", \"content\": \"" + 변수 + "\"}, {\"role\": \"assistant\", \"content\": \"" + 변수 + "\"}]}\n")

#파일 입출력 해제
f.close()
f2.close()

또는, 다른 라이브러리(json 및 전용 라이브러리) 를 활용할 수 있다.

Ubuntu APM 빠른설치 (Apache, PHP, MySQL)

우분투 APM(Apache, PHP, MySQL) 설치하는데 필요 없는 내용 모두 제외 후 필수 핵심 명령어만 정리합니다.

1. Ubuntu 초기설정

sudo apt-get update

2. Apache 설치

sudo apt-get install apache2

3. 방화벽 허용 설정

sudo ufw allow 'Apache'

4. Mysql 설치

sudo apt install mysql-server

5. Mysql 암호 설정

sudo mysql_secure_installation

6. 만약 위 명령어에서 암호 설정이 안 뜬 경우 아래 명령어 실행 후 5번 재실행

sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'mynewpassword';

PHP 설치

sudo apt install php libapache2-mod-php php-mysql

*웹 서버 동작 후 php 작동이 안되는 경우 > 아래 파일 수정

vi /etc/apache2/mods-enabled/mime.conf

적당한 곳에 아래 코드 추가 후 Apache2 재실행

AddType application/x-httpd-php .html .htm .php

워드프레스 멀티도메인 사용 설정하기 / WordPress using Multi-domain with Single-site

한개의 워드프레스 사이트에서 여러개 도메인을 연결해 사용하며 Redirection 이 아닌 각 도메인이 개별적으로 정상 작동하기 위해서는 wp-config.php 파일 수정이 필요하다.

wp-config.php 를 수정하지 않고 여러 도메인을 사용하는 경우 처음 설정한 메인도메인을 제외한 나머지 도메인에서는 이미지 엑스박스가 뜨기 때문에 아래 설정이 필수이다.

*원본 wp-config.php의 내용

<?php
/**
 * The base configuration for WordPress
 *
 * The wp-config.php creation script uses this file during the installation.
 * You don't have to use the web site, you can copy this file to "wp-config.php"
 * and fill in the values.
 *
 * This file contains the following configurations:
 *
 * * Database settings
 * * Secret keys
 * * Database table prefix
 * * ABSPATH
 *
 * @link https://wordpress.org/support/article/editing-wp-config-php/
 *
 * @package WordPress
 */

// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'database' );

/** Database username */
define( 'DB_USER', 'user' );

/** Database password */
define( 'DB_PASSWORD', 'password' );

/** Database hostname */
define( 'DB_HOST', 'localhost' );

/** Database charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8mb4' );

/** The database collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );

/**#@+
 * Authentication unique keys and salts.
 *
 * Change these to different unique phrases! You can generate these using
 * the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}.
 *
 * You can change these at any point in time to invalidate all existing cookies.
 * This will force all users to have to log in again.
 *
 * @since 2.6.0
 */
define( 'AUTH_KEY',         'key1' );
define( 'SECURE_AUTH_KEY',  'key2' );
define( 'LOGGED_IN_KEY',    'key3' );
define( 'NONCE_KEY',        'key4' );
define( 'AUTH_SALT',        'key5' );
define( 'SECURE_AUTH_SALT', 'key6' );
define( 'LOGGED_IN_SALT',   'key7' );
define( 'NONCE_SALT',       'key8' );

/**#@-*/

/**
 * WordPress database table prefix.
 *
 * You can have multiple installations in one database if you give each
 * a unique prefix. Only numbers, letters, and underscores please!
 */
$table_prefix = 'wp_';

/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 *
 * For information on other constants that can be used for debugging,
 * visit the documentation.
 *
 * @link https://wordpress.org/support/article/debugging-in-wordpress/
 */
define( 'WP_DEBUG', false );

/* Add any custom values between this line and the "stop editing" line. */

/* That's all, stop editing! Happy publishing. */

/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
	define( 'ABSPATH', __DIR__ . '/' );
}

/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';

멀티 도메인의 원활한 사용을 위해서는 “Add any custom values between this line and the “stop editing” line.” 이 라인 아래에 코드 추가가 필요하다.

define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST']);
define('WP_CONTENT_URL', "https://{$_SERVER['HTTP_HOST']}/wp-content");
define( 'WP_ALLOW_MULTISITE', true );

위 코드를 추가하면 어떠한 도메인으로 접근하여도 이미지가 잘 보이게 된다.

인류의 마지막 발명품: 인공지능 그리고 인류의 운명

슈퍼인공지능이 존재한다면, 인류의 운명은 그것에 달려있다

인공지능은 인류가 만들어야하는 마지막 발명품이 될 것이다.

Nick Bostrom, Professor of University of Oxford

인공지능(AI)는 최근 폭발적인 기술적 성장을 이루고 있으며, 점차 그 발전 속도가 빨라지고 있다. 이번 기사에서는 인류의 마지막 발명품이 될 인공지능(AI)의 발전 그리고 인류에 대한 그 영향을 심도 있게 탐구하고자 한다.

인공지능의 종류와 단계는 약인공지능(ANI), 강인공지능(AGI), 초지능 또는 초인공지능(ASI) 그리고 초월지능(ATI) 총 4단계로 나눌 수 있다.

  1. 약인공지능(Artificial Narrow Intelligence, ANI): 이 단계의 AI는 특정 작업이나 기능에 초점을 맞추고 있다. 예를 들어, IBM의 왓슨이나 구글의 알파고와 같은 시스템들은 ANI로 볼 수 있다. 이러한 인공지능은 어떤 특정 분야에서 인간의 능력을 능가하거나 보조할 수 있지만, 그 범위나 이해력은 매우 제한적이다. 예를 들어, 체스나 바둑과 같은 특정 게임에서 뛰어난 성능을 보이지만, 그 외의 다른 영역에서는 무능력하다.
  2. 강인공지능(Artificial General Intelligence, AGI): AGI는 인간의 일반적인 지능을 모방하는 단계의 AI입니다. 이 단계의 AI는 다양한 종류의 문제를 해결할 수 있으며, 학습, 이해, 추론, 문제 해결 등 인간과 유사한 지능적 활동을 수행할 수 있습니다. AGI는 여러 분야에 걸쳐 유연하게 적용될 수 있으며, 자가 학습 및 자가 개선 능력을 가집니다. 현재 AGI는 아직 실현되지 않은 목표로 남아 있으나, 관련 연구들이 매우 빠르게 진행되고 있어 가까운 시일에 AGI의 시대가 도래할 것으로 학자들은 전망하고 있다.
  3. 초인공지능(Artificial Superintelligence, ASI): ASI는 인간의 지능을 훨씬 능가하는 인공지능의 단계입니다. 이 단계의 AI는 인간이 수행할 수 있는 모든 지적 활동뿐만 아니라, 창의적이고 복잡한 문제 해결 능력에서도 인간을 초월하는 것을 의미한다. ASI는 자신의 기능을 스스로 개선하며, 지능적 활동의 새로운 경계를 넓힐 수 있다. ASI의 등장은 인간 문명에 근본적인 변화를 가져올 수 있으며, 현재로서는 이러한 단계의 AI가 실현되는 것은 매우 먼 미래의 일이다.
  4. 초월인공지능(Artificial Transintelligence, ATI): ATI는 인간의 지능에 통달한 ASI에서 발전해 인간이 알지 못하는 새로운 지식을 인공지능 스스로 연구하고 발전시켜 인간의 지적 영역을 확장하는 아주 먼 미래에 인류가 도약해야할 인공지능의 최종형태이다.

현재의 인공지능 기술은 ANI와 AGI 사이에 있으며, Open AI ChatGPT와 Google Gemini & Bard가 매우 빠른 속도로 발전함에 따라 곧 AGI의 시대가 도래할 것으로 예측하고 있다.

그림 1. ANI에서 AGI로의 발전 과정 (자료출처: 구글 딥마인드 / 그림출처: 동아일보, https://www.donga.com/news/Inter/article/all/20231124/122328985/1)

그러나 많은 학자 및 전문가들은 AGI를 넘어 ASI 그리고 ATI로 진화와 발전을 하면서 인류가 처한 위험성을 강조한다. 이러한 진화는 인간의 지능을 능가하며, 결과적으로 인류가 AI의 지배를 받게 될 수도 있다는 것이 학계의 주장이다.

전문가들은 인류가 2040~2050년경 기술적 특이점에 도달하게 될 것이라고 예상하며, 이는 인간이 기계와 융합하여 ‘수퍼휴먼’으로 발전할 수 있는 계기가 될 것이라고 예측한다.

학계에서는 이러한 낙관주의를 신중하게 접근해야 한다고 경고한다. 인공지능 발전이 가져올 수 있는 잠재적인 위험과 도전을 강조하며, 이것이 인류에게 닥칠 수 있는 중대한 난제임을 주장한다.

인공지능은 인류를 뛰어넘는 처음이자 마지막의 존재가 될 가능성이 유일한 기술이기에, 초인공지능은 인류를 신과 같은 존재로 만들수도 혹은 인류를 파멸시킬수도 있을 것이다.

때문에, 단순히 기술적인 예측을 넘어서, 인류가 AI와 함께 나아가야 할 미래에 대한 깊은 성찰이 필요하며, AI 발전의 장점과 함께 그로 인해 초래될 수 있는 위험성에 대해 신중하게 생각해 볼 필요가 있다.

[1] Barrat, J. (2013). Our final invention: Artificial intelligence and the end of the human era. St. Martin’s Press.
[2] Bostrom, N. (2015). What happens when our computers get smarter than we are [Video]. TED Conferences. https://www.ted.com/talks/nick_bostrom_what_happens_when_our_computers_get_smarter_than_we_are/transcript?language=ko&subtitle=ko
[3] Kim, H. S. (2023, November 24). 올트먼 복귀작은 ‘무료 음성 챗GPT’… 오픈AI, 빅테크로 간다. Dong-a. Retrieved from https://www.donga.com/news/Inter/article/all/20231124/122328985/1