Jiayi05 commited on
Commit
2c4eec9
Β·
verified Β·
1 Parent(s): b275ea2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +29 -1
README.md CHANGED
@@ -80,6 +80,8 @@ def preprocess_text(text):
80
 
81
 
82
  # Step 3: Load the model and tokenizer from Hugging Face Hub
 
 
83
  ```python
84
  print("Loading model and tokenizer...")
85
  REPO_NAME = "CIS5190GoGo/CustomModel" #This is where we pushed the model to
@@ -94,7 +96,7 @@ print("Model and tokenizer loaded successfully!")
94
  # Step 4: Load test dataset
95
  ```python
96
  print("Loading test data...")
97
- test_data_path = "/content/drive/MyDrive/5190_project/test_data_random_subset.csv" # Replace with your test set path
98
  test_data = pd.read_csv(test_data_path)
99
  ```
100
  # Step 5: Preprocess test data
@@ -129,4 +131,30 @@ with torch.no_grad():
129
 
130
  accuracy = accuracy_score(all_labels, all_preds)
131
  print(f"Test Accuracy: {accuracy:.4f}")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
  ```
 
80
 
81
 
82
  # Step 3: Load the model and tokenizer from Hugging Face Hub
83
+ This step loads the pre-trained model and tokenizer, which are hosted on the Hugging Face Hub.
84
+
85
  ```python
86
  print("Loading model and tokenizer...")
87
  REPO_NAME = "CIS5190GoGo/CustomModel" #This is where we pushed the model to
 
96
  # Step 4: Load test dataset
97
  ```python
98
  print("Loading test data...")
99
+ test_data_path = "Replace wit your test set path" #Note: Replace with your test set path
100
  test_data = pd.read_csv(test_data_path)
101
  ```
102
  # Step 5: Preprocess test data
 
131
 
132
  accuracy = accuracy_score(all_labels, all_preds)
133
  print(f"Test Accuracy: {accuracy:.4f}")
134
+ ```
135
+ # Expected output:
136
+ ```python
137
+ Loading model and tokenizer...
138
+ /usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_auth.py:94: UserWarning:
139
+ The secret `HF_TOKEN` does not exist in your Colab secrets.
140
+ To authenticate with the Hugging Face Hub, create a token in your settings tab (https://huggingface.co/settings/tokens), set it as secret in your Google Colab and restart your session.
141
+ You will be able to reuse this secret in all of your notebooks.
142
+ Please note that authentication is recommended but still optional to access public models or datasets.
143
+ warnings.warn(
144
+ config.json: 100%
145
+  735/735 [00:00<00:00, 40.8kB/s]
146
+ model.safetensors: 100%
147
+  499M/499M [00:11<00:00, 42.7MB/s]
148
+ tokenizer_config.json: 100%
149
+  1.19k/1.19k [00:00<00:00, 69.8kB/s]
150
+ vocab.json: 100%
151
+  999k/999k [00:00<00:00, 4.09MB/s]
152
+ merges.txt: 100%
153
+  456k/456k [00:00<00:00, 2.61MB/s]
154
+ special_tokens_map.json: 100%
155
+  958/958 [00:00<00:00, 57.4kB/s]
156
+ Model and tokenizer loaded successfully!
157
+ Loading test data...
158
+ Evaluating the model...
159
+ Test Accuracy: 0.8500
160
  ```