visobert-multi-task / test_handler.py
bie-nhd's picture
create app.py and handlers
5b2de76
raw
history blame contribute delete
868 Bytes
from handler import EndpointHandler
from huggingface_hub import login
from transformers import AutoTokenizer, AutoModel
import os
# LOGIN TO HUGGINGFACE TO UNLOCK STREAM
login("")
handler = EndpointHandler('bie-nhd/visobert-multitask')
print(handler({'task': 'topic', 'text': 'Thầy cô cho em hỏi đăng ký học ghép môn Kinh tế vi mô ở đâu ạ? Em cảm ơn. ⭐'}))
print(handler({'task': 'all', 'text': 'Thầy cô trường này bị sao ấy??? Học kỳ trước em đăng ký học 2 môn online, giờ học kỳ này vào đăng ký học lại thì bị khóa tài khoản không cho đăng ký học nữa. Em phải làm sao ạ???'}))
# # tokenizer = AutoTokenizer.from_pretrained('bie-nhd/visobert-multitask')
# config = AutoConfig.from_pretrained('bie-nhd/visobert-multitask')
# print(f"PATH: {os.path}")
# print(f"CONFIG: {config}")