mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-07 01:22:59 +08:00
[Other] Avoid to accede C.text.SchemaLanguage (#463)
* avoid to accede C.text.SchemaLanguage * Update SchemaLanguage python impl * Add cast
This commit is contained in:
@@ -19,8 +19,9 @@ from ... import RuntimeOption, FastDeployModel, ModelFormat
|
|||||||
from ... import c_lib_wrap as C
|
from ... import c_lib_wrap as C
|
||||||
|
|
||||||
|
|
||||||
class SchemaLanguage(C.text.SchemaLanguage):
|
class SchemaLanguage(object):
|
||||||
pass
|
ZH = 0
|
||||||
|
EN = 1
|
||||||
|
|
||||||
|
|
||||||
class SchemaNode(object):
|
class SchemaNode(object):
|
||||||
@@ -61,6 +62,7 @@ class UIEModel(FastDeployModel):
|
|||||||
schema = schema_tmp
|
schema = schema_tmp
|
||||||
else:
|
else:
|
||||||
assert "The type of schema should be list or dict."
|
assert "The type of schema should be list or dict."
|
||||||
|
schema_language = C.text.SchemaLanguage(schema_language)
|
||||||
self._model = C.text.UIEModel(
|
self._model = C.text.UIEModel(
|
||||||
model_file, params_file, vocab_file, position_prob, max_length,
|
model_file, params_file, vocab_file, position_prob, max_length,
|
||||||
schema, runtime_option._option, model_format, schema_language)
|
schema, runtime_option._option, model_format, schema_language)
|
||||||
|
Reference in New Issue
Block a user