Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Проблема с парсингом входных данных через api и через socket #1663

Open
clover-soft opened this issue Oct 1, 2023 · 3 comments
Assignees
Labels

Comments

@clover-soft
Copy link

Want to contribute to DeepPavlov? Please read the contributing guideline first.

Please enter all the information below, otherwise your issue may be closed without a warning.

DeepPavlov version (you can look it up by running pip show deeppavlov):
Name: deeppavlov
Version: 1.3.0

Python version:
3.9
Operating system (ubuntu linux, windows, ...):
ubuntu server 22
Issue:

Content or a name of a configuration file:

python -m deeppavlov risesocket -d few_shot_roberta --socket-type TCP -p 5000

отправляем запрос на api либо сокет
вот на примере вашей документации
POST deeppavlov:5000
JSON:
{"texts":[
"what expression would i use to say i love you if i were an italian",
"what's the currency conversion between krones and yen",
"i'd like to reserve a high-end car"
],
"dataset" :[
["please help me book a rental car for nashville", "car_rental"],
["how can i rent a car in boston", "car_rental"],
["help me get a rental car for march 2 to 6th", "car_rental"],

["how many pesos can i get for one dollar",                              "exchange_rate"],
["tell me the exchange rate between rubles and dollars",                 "exchange_rate"],
["what is the exchange rate in pesos for 100 dollars",                   "exchange_rate"],

["can you tell me how to say 'i do not speak much spanish', in spanish", "translate"],
["please tell me how to ask for a taxi in french",                       "translate"],
["how would i say thank you if i were russian",                          "translate"]

]
}

Command that led to error:

deeppavlov  | 2023-10-01 14:09:54.100 ERROR in 'deeppavlov.utils.socket.socket'['socket'] at line 189: got several different batch sizes: {3, 9}

Error (including full traceback):

PS
Нормально отвечает если количество вариантов в dataset совпадает с texts
но это не годится

@clover-soft clover-soft added the bug label Oct 1, 2023
@clover-soft
Copy link
Author

при работе через python работает все ок
проблема только в api и socket

@clover-soft
Copy link
Author

пришлось пока на время закомментить проверку
в файлах socket.py (187-190) и server.py(144-145)
после этого все заработало нормально

@LogicZMaksimka
Copy link
Contributor

Здравствуйте @clover-soft, спасибо за упоминание этого бага! Проблема связана со специфичным форматом входных данных. Я думаю что на данный момент удаления проверок на совпадение размеров батчей это лучший способ исправить ошибку. В дальнейшем мы либо изменим формат входных данных, либо изменим проверки в соответсвующих файлах.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants