Rename tmp dir to sample_data; remove print statements

This commit is contained in:
Jash Gulabrai 2025-04-28 12:04:36 -04:00
parent 73275f07b7
commit e64961697a
10 changed files with 9 additions and 11 deletions

View file

@ -323,19 +323,19 @@
"source": [
"# Upload the files from the local folder\n",
"hf_api.upload_folder(\n",
" folder_path=\"./tmp/sample_squad_data/training\",\n",
" folder_path=\"./sample_data/sample_squad_data/training\",\n",
" path_in_repo=\"training\",\n",
" repo_id=repo_id,\n",
" repo_type=\"dataset\",\n",
")\n",
"hf_api.upload_folder(\n",
" folder_path=\"./tmp/sample_squad_data/validation\",\n",
" folder_path=\"./sample_data/sample_squad_data/validation\",\n",
" path_in_repo=\"validation\",\n",
" repo_id=repo_id,\n",
" repo_type=\"dataset\",\n",
")\n",
"hf_api.upload_folder(\n",
" folder_path=\"./tmp/sample_squad_data/testing\",\n",
" folder_path=\"./sample_data/sample_squad_data/testing\",\n",
" path_in_repo=\"testing\",\n",
" repo_id=repo_id,\n",
" repo_type=\"dataset\",\n",
@ -405,7 +405,7 @@
"import json\n",
"import pprint\n",
"\n",
"with open(\"./tmp/sample_squad_data/testing/testing.jsonl\", \"r\") as f:\n",
"with open(\"./sample_data/sample_squad_data/testing/testing.jsonl\", \"r\") as f:\n",
" examples = [json.loads(line) for line in f]\n",
"\n",
"# Get the user prompt from the last example\n",
@ -864,19 +864,19 @@
"source": [
"# Upload the files from the local folder\n",
"hf_api.upload_folder(\n",
" folder_path=\"./tmp/sample_squad_messages/training\",\n",
" folder_path=\"./sample_data/sample_squad_messages/training\",\n",
" path_in_repo=\"training\",\n",
" repo_id=repo_id,\n",
" repo_type=\"dataset\",\n",
")\n",
"hf_api.upload_folder(\n",
" folder_path=\"./tmp/sample_squad_messages/validation\",\n",
" folder_path=\"./sample_data/sample_squad_messages/validation\",\n",
" path_in_repo=\"validation\",\n",
" repo_id=repo_id,\n",
" repo_type=\"dataset\",\n",
")\n",
"hf_api.upload_folder(\n",
" folder_path=\"./tmp/sample_squad_messages/testing\",\n",
" folder_path=\"./sample_data/sample_squad_messages/testing\",\n",
" path_in_repo=\"testing\",\n",
" repo_id=repo_id,\n",
" repo_type=\"dataset\",\n",
@ -936,7 +936,7 @@
"metadata": {},
"outputs": [],
"source": [
"with open(\"./tmp/sample_squad_messages/testing/testing.jsonl\", \"r\") as f:\n",
"with open(\"./sample_data/sample_squad_messages/testing/testing.jsonl\", \"r\") as f:\n",
" examples = [json.loads(line) for line in f]\n",
"\n",
"# get the user and assistant messages from the last example\n",
@ -1486,7 +1486,7 @@
"# Create dataset and upload test data\n",
"hf_api.create_repo(guardrails_repo_id, repo_type=\"dataset\")\n",
"hf_api.upload_folder(\n",
" folder_path=\"./tmp/sample_content_safety_test_data\",\n",
" folder_path=\"./sample_data/sample_content_safety_test_data\",\n",
" path_in_repo=\"\",\n",
" repo_id=guardrails_repo_id,\n",
" repo_type=\"dataset\",\n",