Spaces:
Sleeping
Sleeping
Download test_handler.py from bie-nhd/visobert-multi-task: direct link, hf CLI and curl.
- Browser
- Download file 868 Bytes
-
https://huggingface.co/spaces/bie-nhd/visobert-multi-task/resolve/main/test_handler.py
- Command line
-
hf download hf://spaces/bie-nhd/visobert-multi-task/test_handler.py
-
curl -L -o test_handler.py https://huggingface.co/spaces/bie-nhd/visobert-multi-task/resolve/main/test_handler.py
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}") |