constant.py 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. # Copyright (c) Alibaba, Inc. and its affiliates.
  2. import enum
  3. import os
  4. class Fields(object):
  5. """ Names for different application fields
  6. """
  7. hub = 'hub'
  8. datasets = 'datasets'
  9. framework = 'framework'
  10. cv = 'cv'
  11. nlp = 'nlp'
  12. audio = 'audio'
  13. multi_modal = 'multi-modal'
  14. science = 'science'
  15. server = 'server'
  16. class CVTasks(object):
  17. # ocr
  18. ocr_detection = 'ocr-detection'
  19. ocr_recognition = 'ocr-recognition'
  20. table_recognition = 'table-recognition'
  21. lineless_table_recognition = 'lineless-table-recognition'
  22. license_plate_detection = 'license-plate-detection'
  23. card_detection_correction = 'card-detection-correction'
  24. # human face body related
  25. animal_recognition = 'animal-recognition'
  26. face_detection = 'face-detection'
  27. face_liveness = 'face-liveness'
  28. face_quality_assessment = 'face-quality-assessment'
  29. card_detection = 'card-detection'
  30. face_recognition = 'face-recognition'
  31. facial_expression_recognition = 'facial-expression-recognition'
  32. face_processing_base = 'face-processing-base'
  33. face_attribute_recognition = 'face-attribute-recognition'
  34. face_2d_keypoints = 'face-2d-keypoints'
  35. facial_68ldk_detection = 'facial-68ldk-detection'
  36. human_detection = 'human-detection'
  37. human_object_interaction = 'human-object-interaction'
  38. face_image_generation = 'face-image-generation'
  39. body_2d_keypoints = 'body-2d-keypoints'
  40. body_3d_keypoints = 'body-3d-keypoints'
  41. hand_2d_keypoints = 'hand-2d-keypoints'
  42. general_recognition = 'general-recognition'
  43. human_wholebody_keypoint = 'human-wholebody-keypoint'
  44. pedestrian_attribute_recognition = 'pedestrian-attribute-recognition'
  45. image_classification = 'image-classification'
  46. image_multilabel_classification = 'image-multilabel-classification'
  47. image_classification_imagenet = 'image-classification-imagenet'
  48. image_classification_dailylife = 'image-classification-dailylife'
  49. image_object_detection = 'image-object-detection'
  50. video_object_detection = 'video-object-detection'
  51. image_fewshot_detection = 'image-fewshot-detection'
  52. open_vocabulary_detection = 'open-vocabulary-detection'
  53. object_detection_3d = 'object-detection-3d'
  54. image_segmentation = 'image-segmentation'
  55. semantic_segmentation = 'semantic-segmentation'
  56. image_driving_perception = 'image-driving-perception'
  57. image_depth_estimation = 'image-depth-estimation'
  58. dense_optical_flow_estimation = 'dense-optical-flow-estimation'
  59. image_normal_estimation = 'image-normal-estimation'
  60. indoor_layout_estimation = 'indoor-layout-estimation'
  61. video_depth_estimation = 'video-depth-estimation'
  62. panorama_depth_estimation = 'panorama-depth-estimation'
  63. portrait_matting = 'portrait-matting'
  64. universal_matting = 'universal-matting'
  65. text_driven_segmentation = 'text-driven-segmentation'
  66. shop_segmentation = 'shop-segmentation'
  67. hand_static = 'hand-static'
  68. face_human_hand_detection = 'face-human-hand-detection'
  69. face_emotion = 'face-emotion'
  70. product_segmentation = 'product-segmentation'
  71. image_matching = 'image-matching'
  72. image_local_feature_matching = 'image-local-feature-matching'
  73. image_quality_assessment_degradation = 'image-quality-assessment-degradation'
  74. human_normal_estimation = 'human-normal-estimation'
  75. crowd_counting = 'crowd-counting'
  76. # image editing
  77. skin_retouching = 'skin-retouching'
  78. image_super_resolution = 'image-super-resolution'
  79. image_super_resolution_pasd = 'image-super-resolution-pasd'
  80. image_debanding = 'image-debanding'
  81. image_colorization = 'image-colorization'
  82. image_color_enhancement = 'image-color-enhancement'
  83. image_denoising = 'image-denoising'
  84. image_deblurring = 'image-deblurring'
  85. image_portrait_enhancement = 'image-portrait-enhancement'
  86. image_inpainting = 'image-inpainting'
  87. image_paintbyexample = 'image-paintbyexample'
  88. image_skychange = 'image-skychange'
  89. image_demoireing = 'image-demoireing'
  90. image_editing = 'image-editing'
  91. # image generation
  92. image_to_image_translation = 'image-to-image-translation'
  93. image_to_image_generation = 'image-to-image-generation'
  94. image_style_transfer = 'image-style-transfer'
  95. image_portrait_stylization = 'image-portrait-stylization'
  96. image_body_reshaping = 'image-body-reshaping'
  97. image_embedding = 'image-embedding'
  98. image_face_fusion = 'image-face-fusion'
  99. product_retrieval_embedding = 'product-retrieval-embedding'
  100. controllable_image_generation = 'controllable-image-generation'
  101. text_to_360panorama_image = 'text-to-360panorama-image'
  102. image_try_on = 'image-try-on'
  103. human_image_generation = 'human-image-generation'
  104. image_view_transform = 'image-view-transform'
  105. # video recognition
  106. live_category = 'live-category'
  107. action_recognition = 'action-recognition'
  108. action_detection = 'action-detection'
  109. video_category = 'video-category'
  110. video_embedding = 'video-embedding'
  111. virtual_try_on = 'virtual-try-on'
  112. movie_scene_segmentation = 'movie-scene-segmentation'
  113. language_guided_video_summarization = 'language-guided-video-summarization'
  114. vop_retrieval = 'video-text-retrieval'
  115. # video segmentation
  116. video_object_segmentation = 'video-object-segmentation'
  117. referring_video_object_segmentation = 'referring-video-object-segmentation'
  118. video_human_matting = 'video-human-matting'
  119. video_panoptic_segmentation = 'video-panoptic-segmentation'
  120. video_instance_segmentation = 'video-instance-segmentation'
  121. # video editing
  122. video_inpainting = 'video-inpainting'
  123. video_frame_interpolation = 'video-frame-interpolation'
  124. video_stabilization = 'video-stabilization'
  125. video_super_resolution = 'video-super-resolution'
  126. video_deinterlace = 'video-deinterlace'
  127. video_colorization = 'video-colorization'
  128. # reid and tracking
  129. video_single_object_tracking = 'video-single-object-tracking'
  130. video_multi_object_tracking = 'video-multi-object-tracking'
  131. video_summarization = 'video-summarization'
  132. image_reid_person = 'image-reid-person'
  133. # pointcloud task
  134. pointcloud_sceneflow_estimation = 'pointcloud-sceneflow-estimation'
  135. # image multi-view depth estimation
  136. image_multi_view_depth_estimation = 'image-multi-view-depth-estimation'
  137. # domain specific object detection
  138. domain_specific_object_detection = 'domain-specific-object-detection'
  139. # content check
  140. content_check = 'content-check'
  141. # 3d face reconstruction
  142. face_reconstruction = 'face-reconstruction'
  143. head_reconstruction = 'head-reconstruction'
  144. text_to_head = 'text-to-head'
  145. # 3d human reconstruction
  146. human_reconstruction = 'human-reconstruction'
  147. text_texture_generation = 'text-texture-generation'
  148. # image quality assessment mos
  149. image_quality_assessment_mos = 'image-quality-assessment-mos'
  150. # motion generation
  151. motion_generation = 'motion-generation'
  152. # 3d reconstruction
  153. nerf_recon_acc = 'nerf-recon-acc'
  154. nerf_recon_4k = 'nerf-recon-4k'
  155. nerf_recon_vq_compression = 'nerf-recon-vq-compression'
  156. surface_recon_common = 'surface-recon-common'
  157. human3d_render = 'human3d-render'
  158. human3d_animation = 'human3d-animation'
  159. image_control_3d_portrait = 'image-control-3d-portrait'
  160. self_supervised_depth_completion = 'self-supervised-depth-completion'
  161. # 3d generation
  162. image_to_3d = 'image-to-3d'
  163. # vision efficient tuning
  164. vision_efficient_tuning = 'vision-efficient-tuning'
  165. # bad image detecting
  166. bad_image_detecting = 'bad-image-detecting'
  167. class NLPTasks(object):
  168. # chat
  169. chat = 'chat'
  170. # nlp tasks
  171. word_segmentation = 'word-segmentation'
  172. part_of_speech = 'part-of-speech'
  173. named_entity_recognition = 'named-entity-recognition'
  174. nli = 'nli'
  175. sentiment_classification = 'sentiment-classification'
  176. sentiment_analysis = 'sentiment-analysis'
  177. sentence_similarity = 'sentence-similarity'
  178. text_classification = 'text-classification'
  179. sentence_embedding = 'sentence-embedding'
  180. text_ranking = 'text-ranking'
  181. relation_extraction = 'relation-extraction'
  182. zero_shot = 'zero-shot'
  183. translation = 'translation'
  184. competency_aware_translation = 'competency-aware-translation'
  185. token_classification = 'token-classification'
  186. transformer_crf = 'transformer-crf'
  187. conversational = 'conversational'
  188. text_generation = 'text-generation'
  189. fid_dialogue = 'fid-dialogue'
  190. text2text_generation = 'text2text-generation'
  191. task_oriented_conversation = 'task-oriented-conversation'
  192. dialog_intent_prediction = 'dialog-intent-prediction'
  193. dialog_state_tracking = 'dialog-state-tracking'
  194. table_question_answering = 'table-question-answering'
  195. fill_mask = 'fill-mask'
  196. text_summarization = 'text-summarization'
  197. question_answering = 'question-answering'
  198. code_translation = 'code-translation'
  199. code_generation = 'code-generation'
  200. zero_shot_classification = 'zero-shot-classification'
  201. backbone = 'backbone'
  202. text_error_correction = 'text-error-correction'
  203. word_alignment = 'word-alignment'
  204. faq_question_answering = 'faq-question-answering'
  205. information_extraction = 'information-extraction'
  206. document_segmentation = 'document-segmentation'
  207. extractive_summarization = 'extractive-summarization'
  208. feature_extraction = 'feature-extraction'
  209. translation_evaluation = 'translation-evaluation'
  210. sudoku = 'sudoku'
  211. text2sql = 'text2sql'
  212. siamese_uie = 'siamese-uie'
  213. document_grounded_dialog_retrieval = 'document-grounded-dialog-retrieval'
  214. document_grounded_dialog_rerank = 'document-grounded-dialog-rerank'
  215. document_grounded_dialog_generate = 'document-grounded-dialog-generate'
  216. machine_reading_comprehension = 'machine-reading-comprehension'
  217. class AudioTasks(object):
  218. # audio tasks
  219. auto_speech_recognition = 'auto-speech-recognition'
  220. text_to_speech = 'text-to-speech'
  221. speech_signal_process = 'speech-signal-process'
  222. speech_separation = 'speech-separation'
  223. acoustic_echo_cancellation = 'acoustic-echo-cancellation'
  224. acoustic_noise_suppression = 'acoustic-noise-suppression'
  225. keyword_spotting = 'keyword-spotting'
  226. inverse_text_processing = 'inverse-text-processing'
  227. punctuation = 'punctuation'
  228. speaker_verification = 'speaker-verification'
  229. speech_language_recognition = 'speech-language-recognition'
  230. speaker_diarization = 'speaker-diarization'
  231. audio_quantization = 'audio-quantization'
  232. voice_activity_detection = 'voice-activity-detection'
  233. language_score_prediction = 'language-score-prediction'
  234. speech_timestamp = 'speech-timestamp'
  235. speaker_diarization_dialogue_detection = 'speaker-diarization-dialogue-detection'
  236. speaker_diarization_semantic_speaker_turn_detection = 'speaker-diarization-semantic-speaker-turn-detection'
  237. emotion_recognition = 'emotion-recognition'
  238. speech_super_resolution = 'speech-super-resolution'
  239. voice_conversion = 'voice-conversion'
  240. class MultiModalTasks(object):
  241. # multi-modal tasks
  242. image_captioning = 'image-captioning'
  243. visual_grounding = 'visual-grounding'
  244. text_to_image_synthesis = 'text-to-image-synthesis'
  245. multi_modal_embedding = 'multi-modal-embedding'
  246. text_video_retrieval = 'text-video-retrieval'
  247. generative_multi_modal_embedding = 'generative-multi-modal-embedding'
  248. multi_modal_similarity = 'multi-modal-similarity'
  249. visual_question_answering = 'visual-question-answering'
  250. visual_entailment = 'visual-entailment'
  251. video_multi_modal_embedding = 'video-multi-modal-embedding'
  252. image_text_retrieval = 'image-text-retrieval'
  253. document_vl_embedding = 'document-vl-embedding'
  254. video_captioning = 'video-captioning'
  255. video_question_answering = 'video-question-answering'
  256. video_temporal_grounding = 'video-temporal-grounding'
  257. text_to_video_synthesis = 'text-to-video-synthesis'
  258. efficient_diffusion_tuning = 'efficient-diffusion-tuning'
  259. multimodal_dialogue = 'multimodal-dialogue'
  260. image_to_video = 'image-to-video'
  261. video_to_video = 'video-to-video'
  262. class ScienceTasks(object):
  263. protein_structure = 'protein-structure'
  264. class Other(object):
  265. other = 'other'
  266. class TasksIODescriptions(object):
  267. image_to_image = 'image_to_image',
  268. images_to_image = 'images_to_image',
  269. image_to_text = 'image_to_text',
  270. seed_to_image = 'seed_to_image',
  271. text_to_speech = 'text_to_speech',
  272. text_to_text = 'text_to_text',
  273. speech_to_text = 'speech_to_text',
  274. speech_to_speech = 'speech_to_speech'
  275. speeches_to_speech = 'speeches_to_speech',
  276. visual_grounding = 'visual_grounding',
  277. visual_question_answering = 'visual_question_answering',
  278. visual_entailment = 'visual_entailment',
  279. generative_multi_modal_embedding = 'generative_multi_modal_embedding'
  280. efficient_diffusion_tuning = 'efficient_diffusion_tuning'
  281. class Tasks(CVTasks, NLPTasks, AudioTasks, MultiModalTasks, ScienceTasks,
  282. Other):
  283. """ Names for tasks supported by modelscope.
  284. Holds the standard task name to use for identifying different tasks.
  285. This should be used to register models, pipelines, trainers.
  286. """
  287. reverse_field_index = {}
  288. task_template = 'task-template'
  289. @staticmethod
  290. def find_field_by_task(task_name):
  291. if len(Tasks.reverse_field_index) == 0:
  292. # Lazy init, not thread safe
  293. field_dict = {
  294. Fields.cv: [
  295. getattr(Tasks, attr) for attr in dir(CVTasks)
  296. if not attr.startswith('__')
  297. ],
  298. Fields.nlp: [
  299. getattr(Tasks, attr) for attr in dir(NLPTasks)
  300. if not attr.startswith('__')
  301. ],
  302. Fields.audio: [
  303. getattr(Tasks, attr) for attr in dir(AudioTasks)
  304. if not attr.startswith('__')
  305. ],
  306. Fields.multi_modal: [
  307. getattr(Tasks, attr) for attr in dir(MultiModalTasks)
  308. if not attr.startswith('__')
  309. ],
  310. Fields.science: [
  311. getattr(Tasks, attr) for attr in dir(ScienceTasks)
  312. if not attr.startswith('__')
  313. ],
  314. }
  315. for field, tasks in field_dict.items():
  316. for task in tasks:
  317. if task in Tasks.reverse_field_index:
  318. raise ValueError(f'Duplicate task: {task}')
  319. Tasks.reverse_field_index[task] = field
  320. return Tasks.reverse_field_index.get(task_name)
  321. class InputFields(object):
  322. """ Names for input data fields in the input data for pipelines
  323. """
  324. img = 'img'
  325. text = 'text'
  326. audio = 'audio'
  327. class Hubs(enum.Enum):
  328. """ Source from which an entity (such as a Dataset or Model) is stored
  329. """
  330. modelscope = 'modelscope'
  331. huggingface = 'huggingface'
  332. virgo = 'virgo'
  333. class DownloadMode(enum.Enum):
  334. """ How to treat existing datasets
  335. """
  336. REUSE_DATASET_IF_EXISTS = 'reuse_dataset_if_exists'
  337. FORCE_REDOWNLOAD = 'force_redownload'
  338. class DownloadChannel(enum.Enum):
  339. """ Channels of datasets downloading for uv/pv counting.
  340. """
  341. LOCAL = 'local'
  342. DSW = 'dsw'
  343. EAIS = 'eais'
  344. class UploadMode(enum.Enum):
  345. """ How to upload object to remote.
  346. """
  347. # Upload all objects from local, existing remote objects may be overwritten. (Default)
  348. OVERWRITE = 'overwrite'
  349. # Upload local objects in append mode, skipping all existing remote objects.
  350. APPEND = 'append'
  351. class DatasetFormations(enum.Enum):
  352. """ How a dataset is organized and interpreted
  353. """
  354. # formation that is compatible with official huggingface dataset, which
  355. # organizes whole dataset into one single (zip) file.
  356. hf_compatible = 1
  357. # native modelscope formation that supports, among other things,
  358. # multiple files in a dataset
  359. native = 2
  360. # general formation for datasets
  361. general = 4
  362. # for local meta cache mark
  363. formation_mark_ext = '.formation_mark'
  364. DatasetMetaFormats = {
  365. DatasetFormations.native: ['.json'],
  366. DatasetFormations.hf_compatible: ['.py'],
  367. DatasetFormations.general: ['.py'],
  368. }
  369. class ModelFile(object):
  370. CONFIGURATION = 'configuration.json'
  371. README = 'README.md'
  372. TF_SAVED_MODEL_FILE = 'saved_model.pb'
  373. TF_GRAPH_FILE = 'tf_graph.pb'
  374. TF_CHECKPOINT_FOLDER = 'tf_ckpts'
  375. TF_CKPT_PREFIX = 'ckpt-'
  376. TORCH_MODEL_FILE = 'pytorch_model.pt'
  377. TORCH_MODEL_BIN_FILE = 'pytorch_model.bin'
  378. VOCAB_FILE = 'vocab.txt'
  379. ONNX_MODEL_FILE = 'model.onnx'
  380. LABEL_MAPPING = 'label_mapping.json'
  381. TRAIN_OUTPUT_DIR = 'output'
  382. TRAIN_BEST_OUTPUT_DIR = 'output_best'
  383. TS_MODEL_FILE = 'model.ts'
  384. YAML_FILE = 'model.yaml'
  385. TOKENIZER_FOLDER = 'tokenizer'
  386. CONFIG = 'config.json'
  387. class Invoke(object):
  388. KEY = 'invoked_by'
  389. PRETRAINED = 'from_pretrained'
  390. PIPELINE = 'pipeline'
  391. TRAINER = 'trainer'
  392. LOCAL_TRAINER = 'local_trainer'
  393. PREPROCESSOR = 'preprocessor'
  394. class ThirdParty(object):
  395. KEY = 'third_party'
  396. EASYCV = 'easycv'
  397. ADASEQ = 'adaseq'
  398. ADADET = 'adadet'
  399. class ConfigFields(object):
  400. """ First level keyword in configuration file
  401. """
  402. framework = 'framework'
  403. task = 'task'
  404. pipeline = 'pipeline'
  405. model = 'model'
  406. dataset = 'dataset'
  407. preprocessor = 'preprocessor'
  408. train = 'train'
  409. evaluation = 'evaluation'
  410. postprocessor = 'postprocessor'
  411. class ConfigKeys(object):
  412. """Fixed keywords in configuration file"""
  413. train = 'train'
  414. val = 'val'
  415. test = 'test'
  416. class Requirements(object):
  417. """Requirement names for each module
  418. """
  419. protobuf = 'protobuf'
  420. sentencepiece = 'sentencepiece'
  421. sklearn = 'sklearn'
  422. scipy = 'scipy'
  423. timm = 'timm'
  424. tokenizers = 'tokenizers'
  425. tf = 'tf'
  426. torch = 'torch'
  427. class Frameworks(object):
  428. tf = 'tensorflow'
  429. torch = 'pytorch'
  430. kaldi = 'kaldi'
  431. REPO_TYPE_MODEL = 'model'
  432. REPO_TYPE_DATASET = 'dataset'
  433. REPO_TYPE_SUPPORT = [REPO_TYPE_MODEL, REPO_TYPE_DATASET]
  434. DEFAULT_MODEL_REVISION = 'master'
  435. MASTER_MODEL_BRANCH = 'master'
  436. DEFAULT_REPOSITORY_REVISION = 'master'
  437. DEFAULT_DATASET_REVISION = 'master'
  438. DEFAULT_DATASET_NAMESPACE = 'modelscope'
  439. DEFAULT_DATA_ACCELERATION_ENDPOINT = 'https://oss-accelerate.aliyuncs.com'
  440. INTRA_CLOUD_ACCELERATION = str(
  441. os.environ.get('INTRA_CLOUD_ACCELERATION', 'True')).lower()
  442. INTRA_CLOUD_ACCELERATION_REGION = str(
  443. os.environ.get('INTRA_CLOUD_ACCELERATION_REGION', '')).lower()
  444. class ModeKeys:
  445. TRAIN = 'train'
  446. EVAL = 'eval'
  447. INFERENCE = 'inference'
  448. class LogKeys:
  449. ITER = 'iter'
  450. ITER_TIME = 'iter_time'
  451. EPOCH = 'epoch'
  452. LR = 'lr' # learning rate
  453. MODE = 'mode'
  454. DATA_LOAD_TIME = 'data_load_time'
  455. ETA = 'eta' # estimated time of arrival
  456. MEMORY = 'memory'
  457. LOSS = 'loss'
  458. class TrainerStages:
  459. after_init = 'after_init'
  460. before_run = 'before_run'
  461. before_val = 'before_val'
  462. before_train_epoch = 'before_train_epoch'
  463. before_train_iter = 'before_train_iter'
  464. after_train_iter = 'after_train_iter'
  465. after_train_epoch = 'after_train_epoch'
  466. before_val_epoch = 'before_val_epoch'
  467. before_val_iter = 'before_val_iter'
  468. after_val_iter = 'after_val_iter'
  469. after_val_epoch = 'after_val_epoch'
  470. after_run = 'after_run'
  471. after_val = 'after_val'
  472. class ColorCodes:
  473. MAGENTA = '\033[95m'
  474. YELLOW = '\033[93m'
  475. GREEN = '\033[92m'
  476. RED = '\033[91m'
  477. END = '\033[0m'
  478. class Devices:
  479. """device used for training and inference"""
  480. cpu = 'cpu'
  481. gpu = 'gpu'
  482. # Supported extensions for text datasets.
  483. EXTENSIONS_TO_LOAD = {
  484. 'csv': 'csv',
  485. 'tsv': 'csv',
  486. 'json': 'json',
  487. 'jsonl': 'json',
  488. 'parquet': 'parquet',
  489. 'txt': 'text'
  490. }
  491. META_FILES_FORMAT = ('.csv', '.jsonl')
  492. class DatasetPathName:
  493. META_NAME = 'meta'
  494. DATA_FILES_NAME = 'data_files'
  495. LOCK_FILE_NAME_ANY = 'any'
  496. LOCK_FILE_NAME_DELIMITER = '-'
  497. class MetaDataFields:
  498. ARGS_BIG_DATA = 'big_data'
  499. class DistributedParallelType(object):
  500. """Parallel Strategies for Distributed Models"""
  501. DP = 'data_parallel'
  502. TP = 'tensor_model_parallel'
  503. PP = 'pipeline_model_parallel'
  504. class DatasetTensorflowConfig:
  505. BATCH_SIZE = 'batch_size'
  506. DEFAULT_BATCH_SIZE_VALUE = 5
  507. class VirgoDatasetConfig:
  508. default_virgo_namespace = 'default_namespace'
  509. default_dataset_version = '1'
  510. env_virgo_endpoint = 'VIRGO_ENDPOINT'
  511. # Columns for meta request
  512. meta_content = 'metaContent'
  513. sampling_type = 'samplingType'
  514. # Columns for meta content
  515. col_id = 'id'
  516. col_meta_info = 'meta_info'
  517. col_analysis_result = 'analysis_result'
  518. col_external_info = 'external_info'
  519. col_cache_file = 'cache_file'
  520. DEFAULT_MAXCOMPUTE_ENDPOINT = 'http://service-corp.odps.aliyun-inc.com/api'
  521. class MaxComputeEnvs:
  522. ACCESS_ID = 'ODPS_ACCESS_ID'
  523. ACCESS_SECRET_KEY = 'ODPS_ACCESS_SECRET_KEY'
  524. PROJECT_NAME = 'ODPS_PROJECT_NAME'
  525. ENDPOINT = 'ODPS_ENDPOINT'