Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,19 @@ RUN sudo pip install -r requirements_2.txt

RUN sudo mkdir /var/log/kovand/ \
/var/log/ropstend/ \
/var/log/mainnetd/ \
/var/log/topic_grpc/ \
/var/log/topic_rest/

RUN mkdir /home/top/pay/ \
/home/top/daemons/ \
/home/top/pay/kovan/ \
/home/top/pay/ropsten/ \
/home/top/pay/mainnet/ \
/home/top/gunicorn/ \
/home/top/daemons/kovan/ \
/home/top/daemons/ropsten/ \
/home/top/daemons/mainnet/ \
/home/top/dep/ \
/home/top/dep/appData/ \
/home/top/dep/appData/plsa/ \
Expand All @@ -63,12 +66,13 @@ RUN mkdir /home/top/pay/ \
/home/top/dep/appData/plsa/plsa-parameters


ENV DAEMON_VERSION 0.1.6
ENV DAEMON_VERSION 0.1.7

RUN wget -O snet-daemon.tar.gz https://github.com/singnet/snet-daemon/releases/download/v$DAEMON_VERSION/snet-daemon-v$DAEMON_VERSION-linux-amd64.tar.gz && \
tar --strip-components=1 -xzf snet-daemon.tar.gz && \
cp snetd /home/top/daemons/kovan/ && \
cp snetd /home/top/daemons/ropsten/
cp snetd /home/top/daemons/ropsten/ && \
cp snetd /home/top/daemons/mainnet/

RUN sudo apt-get update && DEBIAN_FRONTEND=noninteractive sudo apt-get install -y locales

Expand All @@ -82,9 +86,11 @@ RUN echo 37

COPY daemons/snetd_topic_kovan.json /home/top/daemons/kovan/
COPY daemons/snetd_topic_ropsten.json /home/top/daemons/ropsten/
COPY daemons/snetd_topic_mainnet.json /home/top/daemons/mainnet/
COPY gunicorn/config.py /home/top/gunicorn/
COPY supervisor/kovand.conf /etc/supervisor/conf.d/
COPY supervisor/ropstend.conf /etc/supervisor/conf.d/
COPY supervisor/mainnet.conf /etc/supervisor/conf.d/
COPY supervisor/topic_grpc.conf /etc/supervisor/conf.d/
COPY supervisor/topic_rest.conf /etc/supervisor/conf.d/
COPY supervisor/supervisord.conf /etc/supervisor/
Expand Down
20 changes: 20 additions & 0 deletions Docker/supervisor/mainnetd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[supervisord]
logfile=/dev/null
nodaemon=true

[program:mainnetd]
command=/home/top/daemons/mainnet/snetd serve --config /home/top/daemons/mainnet/snetd_topic_mainnet.json
;directory=/home/top/daemons/mainnet
user=root
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
redirect_stderr=true
;stderr_logfile=/var/log/mainnet/err.log
;stdout_logfile=/var/log/mainnet/out.log
;redirect_stderr=true
;stdout_logfile_maxbytes=10MB
;stdout_logfile_backups=100
;stderr_logfile_maxbytes=10MB
;stderr_logfile_backups=100
19 changes: 19 additions & 0 deletions docs/tests/test_doc_2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Toward Democratic, Lawful Citizenship for AIs, Robots, and Corporations

Dr. Ben Goertzel, CEO of SingularityNET, shares his thoughts about the AI Citizenship Test

I am writing this on a plane flying away from Malta, where I just spoke about SingularityNET at the Malta Blockchain Summit.

It was my first time on Malta, and after the event, I took the afternoon to explore some of the elegant, quaint, ancient neighborhoods of the island.

Walking through medieval alleyways by the rocky coast, I felt an ironic contrast between my elegant surroundings and the main reason I had decided to allocate a couple days from my insanely busy schedule to this Malta event: not just the conference itself, but also the opportunity to meet with the top levels of the Malta government to discuss the enablement of Maltese citizenship for AIs, robots and automated corporations.

The folks who had built the stone walls lining the narrow Maltese roads, still standing strong centuries later, had probably not foreseen their blue-wave-lapped island becoming a nexus of thinking at the intersection of general intelligence theory, cryptography, distributed systems, and advanced legal theory.

The Hanson Robot Sophia, with whose development I've been intimately involved via my role as Chief Scientist of Hanson Robotics, was granted citizenship of Saudi Arabia this year. This was an exciting landmark event, however, its significance is muddled a bit by the fact that Saudi Arabia is not governed by rule of law in the modern sense.

In a nation governed by rule of law, citizenship has a clearly defined meaning with rights and responsibilities relatively straightforwardly derivable from written legal documents using modern analytical logic (admittedly with some measure of quasi-subjective interpretation via case law).

Saudi Arabian citizenship also has a real meaning, but it's a different sort of meaning — derivable from various historical Islamic writings (the Quran, the hadiths, etc.) based on deep contextual interpretation by modern and historical Islamic figures. This is a species of legal interpretation that is understood rather poorly by myself personally, and one that is less easily comprehensible by current AIs.

I'm aware that affiliation with Saudi Arabia in any sense has become controversial in recent weeks due to the apparent murder of Jamal Khashoggi.
5 changes: 5 additions & 0 deletions plsa-service/plsa/example_plsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,11 @@ def train(data,empty_docs_list,json_files_list,maxiter=500, debug=True):

word_by_topic_conditional = open(PATH_word_by_topic_conditional+'.csv', "w")

global num_topics_generated
if len(plsa.p_w_z) < 300:
num_topics_generated = len(plsa.p_w_z)


p_w_z_transposed_truncated = np.sort(plsa.p_w_z.transpose()[:,0:num_topics_generated])

for i in range(p_w_z_transposed_truncated.__len__()):
Expand Down
10 changes: 5 additions & 5 deletions snet_test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def sample_data():

def sample_data_2():

path = str(pathlib.Path(os.path.abspath('')).parents[0])+'/topic-analysis/docs/tests/test_doc.txt'
path = str(pathlib.Path(os.path.abspath('')).parents[0])+'/topic-analysis/docs/tests/test_doc_2.txt'

docs = []

Expand Down Expand Up @@ -90,8 +90,8 @@ def try_plsa():


def try_plsa_2():
# channel = grpc.insecure_channel('localhost:5000')
channel = grpc.insecure_channel('172.17.1.53:5001')
channel = grpc.insecure_channel('localhost:5000')
# channel = grpc.insecure_channel('172.17.1.53:5001')
# channel = grpc.insecure_channel('172.17.0.75:5001')
stub = topic_analysis_pb2_grpc.TopicAnalysisStub(channel)

Expand All @@ -115,8 +115,8 @@ def try_plsa_2():
if __name__ == '__main__':

# try_plsa()
print(sample_data_2())
# try_plsa_2()
# print(sample_data_2())
try_plsa_2()
# csv_reader()