Skip to content

Commit

Permalink
[Other] Avoid to accede C.text.SchemaLanguage (#463)
Browse files Browse the repository at this point in the history
* avoid to accede C.text.SchemaLanguage

* Update SchemaLanguage python impl

* Add cast
  • Loading branch information
joey12300 authored Oct 31, 2022
1 parent f274713 commit 441b82d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/fastdeploy/text/uie/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
from ... import c_lib_wrap as C


class SchemaLanguage(C.text.SchemaLanguage):
pass
class SchemaLanguage(object):
ZH = 0
EN = 1


class SchemaNode(object):
Expand Down Expand Up @@ -61,6 +62,7 @@ def __init__(self,
schema = schema_tmp
else:
assert "The type of schema should be list or dict."
schema_language = C.text.SchemaLanguage(schema_language)
self._model = C.text.UIEModel(
model_file, params_file, vocab_file, position_prob, max_length,
schema, runtime_option._option, model_format, schema_language)
Expand Down

0 comments on commit 441b82d

Please sign in to comment.