r"""Encode multiple prompt instructions into a single string.
(question: str, dataset_name: str)
| 58 | # This function is migrated from the original repo: |
| 59 | # https://github.com/ShishirPatil/gorilla |
| 60 | def encode_question(question: str, dataset_name: str) -> str: |
| 61 | r"""Encode multiple prompt instructions into a single string.""" |
| 62 | |
| 63 | if dataset_name == "torchhub": |
| 64 | domains = "1. $DOMAIN is inferred from the task description and \ |
| 65 | should include one of {Classification, Semantic Segmentation, \ |
| 66 | Object Detection, Audio Separation, Video Classification, \ |
| 67 | Text-to-Speech}." |
| 68 | elif dataset_name == "huggingface": |
| 69 | domains = "1. $DOMAIN should include one of {Multimodal Feature \ |
| 70 | Extraction, Multimodal Text-to-Image, Multimodal \ |
| 71 | Image-to-Text, Multimodal Text-to-Video, \ |
| 72 | Multimodal Visual Question Answering, Multimodal Document \ |
| 73 | Question Answer, Multimodal Graph Machine Learning, \ |
| 74 | Computer Vision Depth Estimation, Computer Vision Image \ |
| 75 | Classification, Computer Vision Object Detection, \ |
| 76 | Computer Vision Image Segmentation, Computer Vision \ |
| 77 | Image-to-Image, Computer Vision Unconditional \ |
| 78 | Image Generation, Computer Vision Video Classification, \ |
| 79 | Computer Vision Zero-Shor Image Classification, \ |
| 80 | Natural Language Processing Text Classification, \ |
| 81 | Natural Language Processing Token Classification, \ |
| 82 | Natural Language Processing Table Question Answering, \ |
| 83 | Natural Language Processing Question Answering, \ |
| 84 | Natural Language Processing, Zero-Shot Classification \ |
| 85 | Natural Language Processing Translation, Natural Language \ |
| 86 | Processing Summarization, Natural Language Processing \ |
| 87 | Conversational, Natural Language Processing Text \ |
| 88 | Generation, Natural Language Processing Fill-Mask, \ |
| 89 | Natural Language Processing Text2Text Generation, \ |
| 90 | Natural Language Processing Sentence Similarity, \ |
| 91 | Audio Text-to-Speech, Audio Automatic Speech Recognition, \ |
| 92 | Audio Audio-to-Audio, Audio Audio Classification, \ |
| 93 | Audio Voice Activity Detection, Tabular Tabular \ |
| 94 | Classification, Tabular Tabular Regression, \ |
| 95 | Reinforcement Learning Reinforcement Learning, \ |
| 96 | Reinforcement Learning Robotics }" |
| 97 | elif dataset_name == "tensorflowhub": |
| 98 | domains = "1. $DOMAIN is inferred from the task description \ |
| 99 | and should include one of {text-sequence-alignment, \ |
| 100 | text-embedding, text-language-model, text-preprocessing, \ |
| 101 | text-classification, text-generation, text-question-answering, \ |
| 102 | text-retrieval-question-answering, text-segmentation, \ |
| 103 | text-to-mel, image-classification, image-feature-vector, \ |
| 104 | image-object-detection, image-segmentation, \ |
| 105 | image-generator, image-pose-detection, image-rnn-agent, \ |
| 106 | image-augmentation, image-classifier, image-style-transfer, \ |
| 107 | image-aesthetic-quality, image-depth-estimation, \ |
| 108 | image-super-resolution, image-deblurring, image-extrapolation, \ |
| 109 | image-text-recognition, image-dehazing, image-deraining, \ |
| 110 | image-enhancemenmt, image-classification-logits, \ |
| 111 | image-frame-interpolation, image-text-detection, image-denoising, \ |
| 112 | image-others, video-classification, video-feature-extraction, \ |
| 113 | video-generation, video-audio-text, video-text, \ |
| 114 | audio-embedding, audio-event-classification, audio-command-detection, \ |
| 115 | audio-paralinguists-classification, audio-speech-to-text, \ |
| 116 | audio-speech-synthesis, audio-synthesis, audio-pitch-extraction}" |
| 117 | else: |