Download fallback_template.py from NCEE-Build-Lab/watsonx.ai_AI_Service_Deployment_MNB_V1: direct link, hf CLI and curl.
- Browser
- Download file 1.91 kB
-
https://huggingface.co/spaces/NCEE-Build-Lab/watsonx.ai_AI_Service_Deployment_MNB_V1/resolve/main/fallback_template.py
- Command line
-
hf download hf://spaces/NCEE-Build-Lab/watsonx.ai_AI_Service_Deployment_MNB_V1/fallback_template.py
-
curl -L -o fallback_template.py https://huggingface.co/spaces/NCEE-Build-Lab/watsonx.ai_AI_Service_Deployment_MNB_V1/resolve/main/fallback_template.py
1.91 kB
| fallback_template = { | |
| "id": "7bcc0723c4dca96f0a25a8babdb13a05", | |
| "key": "7bcc0723c4dca96f0a25a8babdb13a05", | |
| "value": { | |
| "rev": "2-6b19a5f38c311dfe11977294434d5cdf" | |
| }, | |
| "doc": { | |
| "_id": "7bcc0723c4dca96f0a25a8babdb13a05", | |
| "_rev": "2-6b19a5f38c311dfe11977294434d5cdf", | |
| "filename": "deployable_function_your_function_name.py", | |
| "text": "def your_function_name():\n def score(input_data):\n original_string = input_data.get(\"input_data\")[0].get(\"values\")[0][0]\n append_string = input_data.get(\"input_data\")[0].get(\"values\")[0][1]\n \n hello_world_message = \"Hello World + {0}\".format(original_string)\n concatenated_string = original_string + append_string\n \n score_response = {\n 'predictions': [{'fields': ['response_message_field', 'random_appended_string'],\n 'values': [[hello_world_message, concatenated_string]]\n }]\n }\n return score_response\n return score\n score = your_function_name()", | |
| "score_assignment": "score = your_function_name()", | |
| "input_schema": [ | |
| { | |
| "id": "1", | |
| "type": "struct", | |
| "fields": [ | |
| { | |
| "name": "response_message_field", | |
| "type": "string", | |
| "nullable": False, | |
| "metadata": {} | |
| }, | |
| { | |
| "name": "random_appended_string", | |
| "type": "string", | |
| "nullable": False, | |
| "metadata": {} | |
| } | |
| ] | |
| } | |
| ], | |
| "output_schema": [ | |
| { | |
| "id": "1", | |
| "type": "struct", | |
| "fields": [ | |
| { | |
| "name": "hello_world_message", | |
| "type": "string", | |
| "nullable": False, | |
| "metadata": {} | |
| }, | |
| { | |
| "name": "concatenated_string", | |
| "type": "string", | |
| "nullable": False, | |
| "metadata": {} | |
| } | |
| ] | |
| } | |
| ], | |
| "dependencies": [ | |
| "<library_to_add>", | |
| "<library_to_add>" | |
| ], | |
| "function_name": "your_function_name", | |
| "category": "base_template", | |
| "prompt_template": "{text}", | |
| "use_cases": [ | |
| "add_tags" | |
| ], | |
| "type": "wx.ai Deployable Python Function" | |
| } | |
| } | |