Giter Club home page Giter Club logo

Comments (5)

giggls avatar giggls commented on May 28, 2024

Did you install the Debian packages?

from osml10n.

comiquita avatar comiquita commented on May 28, 2024

I ended up having the same issues already raised in https://github.com/giggls/osml10n/issues/19. So that helped move forward.

Right now, after starting the server like this:
/usr/bin/geo-transcript-srv.py -s -g /usr/share/osml10n/boundaries

I get:
Loading osml10n transcription server: ready.

I open another terminal and cd to /osml10n and type make test. All tests pass ending in a line as follows:
87 tests passed, 0 tests failed.

However, the server spits out errors througout when tests are running:

--- Logging error --- Traceback (most recent call last): File "/usr/lib/python3.10/logging/__init__.py", line 1103, in emit stream.write(msg + self.terminator) ValueError: I/O operation on closed file. Call stack: File "/usr/bin/geo-transcript-srv.py", line 275, in <module> asyncio.run(main()) File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.10/asyncio/base_events.py", line 633, in run_until_complete self.run_forever() File "/usr/lib/python3.10/asyncio/base_events.py", line 600, in run_forever self._run_once() File "/usr/lib/python3.10/asyncio/base_events.py", line 1896, in _run_once handle._run() File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run self._context.run(self._callback, *self._args) File "/usr/bin/geo-transcript-srv.py", line 248, in handle_connection reply = tc.transcript(id,cc,name) File "/usr/bin/geo-transcript-srv.py", line 149, in transcript return(cantonese_transcript(unistr)) File "/usr/bin/geo-transcript-srv.py", line 93, in cantonese_transcript transcript=pinyin_jyutping_sentence.jyutping(st, spaces=True) File "/home/alexander/.local/lib/python3.10/site-packages/pinyin_jyutping_sentence/__init__.py", line 390, in process_sentence_jyutping return self.process_sentence(sentence, self.conversion_data.jyutping_word_map, self.conversion_data.jyutping_char_map, self.decode_jyutping, tone_numbers, spaces, remove_tones) File "/home/alexander/.local/lib/python3.10/site-packages/pinyin_jyutping_sentence/__init__.py", line 379, in process_sentence word_list = list(seg_list) File "/home/alexander/.local/lib/python3.10/site-packages/jieba/__init__.py", line 325, in cut for word in cut_block(blk): File "/home/alexander/.local/lib/python3.10/site-packages/jieba/__init__.py", line 250, in __cut_DAG DAG = self.get_DAG(sentence) File "/home/alexander/.local/lib/python3.10/site-packages/jieba/__init__.py", line 181, in get_DAG self.check_initialized() File "/home/alexander/.local/lib/python3.10/site-packages/jieba/__init__.py", line 170, in check_initialized self.initialize() File "/home/alexander/.local/lib/python3.10/site-packages/jieba/__init__.py", line 113, in initialize default_logger.debug("Building prefix dict from %s ..." % (abs_path or 'the default dictionary')) Message: 'Building prefix dict from the default dictionary ...' Arguments: () --- Logging error --- Traceback (most recent call last): File "/usr/lib/python3.10/logging/__init__.py", line 1103, in emit stream.write(msg + self.terminator) ValueError: I/O operation on closed file. Call stack: File "/usr/bin/geo-transcript-srv.py", line 275, in <module> asyncio.run(main()) File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.10/asyncio/base_events.py", line 633, in run_until_complete self.run_forever() File "/usr/lib/python3.10/asyncio/base_events.py", line 600, in run_forever self._run_once() File "/usr/lib/python3.10/asyncio/base_events.py", line 1896, in _run_once handle._run() File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run self._context.run(self._callback, *self._args) File "/usr/bin/geo-transcript-srv.py", line 248, in handle_connection reply = tc.transcript(id,cc,name) File "/usr/bin/geo-transcript-srv.py", line 149, in transcript return(cantonese_transcript(unistr)) File "/usr/bin/geo-transcript-srv.py", line 93, in cantonese_transcript transcript=pinyin_jyutping_sentence.jyutping(st, spaces=True) File "/home/alexander/.local/lib/python3.10/site-packages/pinyin_jyutping_sentence/__init__.py", line 390, in process_sentence_jyutping return self.process_sentence(sentence, self.conversion_data.jyutping_word_map, self.conversion_data.jyutping_char_map, self.decode_jyutping, tone_numbers, spaces, remove_tones) File "/home/alexander/.local/lib/python3.10/site-packages/pinyin_jyutping_sentence/__init__.py", line 379, in process_sentence word_list = list(seg_list) File "/home/alexander/.local/lib/python3.10/site-packages/jieba/__init__.py", line 325, in cut for word in cut_block(blk): File "/home/alexander/.local/lib/python3.10/site-packages/jieba/__init__.py", line 250, in __cut_DAG DAG = self.get_DAG(sentence) File "/home/alexander/.local/lib/python3.10/site-packages/jieba/__init__.py", line 181, in get_DAG self.check_initialized() File "/home/alexander/.local/lib/python3.10/site-packages/jieba/__init__.py", line 170, in check_initialized self.initialize() File "/home/alexander/.local/lib/python3.10/site-packages/jieba/__init__.py", line 146, in initialize default_logger.debug( Message: 'Dumping model to file cache /tmp/jieba.cache' Arguments: () --- Logging error --- Traceback (most recent call last): File "/usr/lib/python3.10/logging/__init__.py", line 1103, in emit stream.write(msg + self.terminator) ValueError: I/O operation on closed file. Call stack: File "/usr/bin/geo-transcript-srv.py", line 275, in <module> asyncio.run(main()) File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.10/asyncio/base_events.py", line 633, in run_until_complete self.run_forever() File "/usr/lib/python3.10/asyncio/base_events.py", line 600, in run_forever self._run_once() File "/usr/lib/python3.10/asyncio/base_events.py", line 1896, in _run_once handle._run() File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run self._context.run(self._callback, *self._args) File "/usr/bin/geo-transcript-srv.py", line 248, in handle_connection reply = tc.transcript(id,cc,name) File "/usr/bin/geo-transcript-srv.py", line 149, in transcript return(cantonese_transcript(unistr)) File "/usr/bin/geo-transcript-srv.py", line 93, in cantonese_transcript transcript=pinyin_jyutping_sentence.jyutping(st, spaces=True) File "/home/alexander/.local/lib/python3.10/site-packages/pinyin_jyutping_sentence/__init__.py", line 390, in process_sentence_jyutping return self.process_sentence(sentence, self.conversion_data.jyutping_word_map, self.conversion_data.jyutping_char_map, self.decode_jyutping, tone_numbers, spaces, remove_tones) File "/home/alexander/.local/lib/python3.10/site-packages/pinyin_jyutping_sentence/__init__.py", line 379, in process_sentence word_list = list(seg_list) File "/home/alexander/.local/lib/python3.10/site-packages/jieba/__init__.py", line 325, in cut for word in cut_block(blk): File "/home/alexander/.local/lib/python3.10/site-packages/jieba/__init__.py", line 250, in __cut_DAG DAG = self.get_DAG(sentence) File "/home/alexander/.local/lib/python3.10/site-packages/jieba/__init__.py", line 181, in get_DAG self.check_initialized() File "/home/alexander/.local/lib/python3.10/site-packages/jieba/__init__.py", line 170, in check_initialized self.initialize() File "/home/alexander/.local/lib/python3.10/site-packages/jieba/__init__.py", line 164, in initialize default_logger.debug( Message: 'Loading model cost 0.375 seconds.' Arguments: () --- Logging error --- Traceback (most recent call last): File "/usr/lib/python3.10/logging/__init__.py", line 1103, in emit stream.write(msg + self.terminator) ValueError: I/O operation on closed file. Call stack: File "/usr/bin/geo-transcript-srv.py", line 275, in <module> asyncio.run(main()) File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.10/asyncio/base_events.py", line 633, in run_until_complete self.run_forever() File "/usr/lib/python3.10/asyncio/base_events.py", line 600, in run_forever self._run_once() File "/usr/lib/python3.10/asyncio/base_events.py", line 1896, in _run_once handle._run() File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run self._context.run(self._callback, *self._args) File "/usr/bin/geo-transcript-srv.py", line 248, in handle_connection reply = tc.transcript(id,cc,name) File "/usr/bin/geo-transcript-srv.py", line 149, in transcript return(cantonese_transcript(unistr)) File "/usr/bin/geo-transcript-srv.py", line 93, in cantonese_transcript transcript=pinyin_jyutping_sentence.jyutping(st, spaces=True) File "/home/alexander/.local/lib/python3.10/site-packages/pinyin_jyutping_sentence/__init__.py", line 390, in process_sentence_jyutping return self.process_sentence(sentence, self.conversion_data.jyutping_word_map, self.conversion_data.jyutping_char_map, self.decode_jyutping, tone_numbers, spaces, remove_tones) File "/home/alexander/.local/lib/python3.10/site-packages/pinyin_jyutping_sentence/__init__.py", line 379, in process_sentence word_list = list(seg_list) File "/home/alexander/.local/lib/python3.10/site-packages/jieba/__init__.py", line 325, in cut for word in cut_block(blk): File "/home/alexander/.local/lib/python3.10/site-packages/jieba/__init__.py", line 250, in __cut_DAG DAG = self.get_DAG(sentence) File "/home/alexander/.local/lib/python3.10/site-packages/jieba/__init__.py", line 181, in get_DAG self.check_initialized() File "/home/alexander/.local/lib/python3.10/site-packages/jieba/__init__.py", line 170, in check_initialized self.initialize() File "/home/alexander/.local/lib/python3.10/site-packages/jieba/__init__.py", line 166, in initialize default_logger.debug("Prefix dict has been built successfully.") Message: 'Prefix dict has been built successfully.' Arguments: ()
are this "normal"/expected errors?... I'm going to check if another issue has been raised previously.

from osml10n.

giggls avatar giggls commented on May 28, 2024

You should not need to start the Server manually, the Debian package should do this for you.
Unfortunately I can not reproduce this easily as I do not use ubuntu. Will try to check this inside a chroot.

from osml10n.

giggls avatar giggls commented on May 28, 2024

OK, I can reproduce this in my Ubuntu 22.04 chroot.
Looks like this stderr redirection hack no longer works in Python 3.10
Does not seem to harm functionality though.
I will see what I can do.

from osml10n.

comiquita avatar comiquita commented on May 28, 2024

Thank you for looking into it.

from osml10n.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.