Spaces:
Sleeping
Sleeping
Updated tensor board links
Browse files
app.py
CHANGED
@@ -60,14 +60,14 @@ def AlbertUntrained_fn(text1, text2):
|
|
60 |
|
61 |
|
62 |
# Handle calls to Deberta--------------------------------------------
|
63 |
-
# base_model2 =
|
64 |
# peft_model_id2 = "rajevan123/STS-Lora-Fine-Tuning-Capstone-Deberta-old-model-pipe-test_augmentation"
|
65 |
# model2 = PeftModel.from_pretrained(model=base_model2, model_id=peft_model_id2)
|
66 |
# sa_merged_model2 = model2.merge_and_unload()
|
67 |
# bbu_tokenizer2 = AutoTokenizer.from_pretrained("microsoft/deberta-v3-xsmall")
|
68 |
|
69 |
DebertaUntrained_pipe = pipeline("text-classification", model="microsoft/deberta-v3-xsmall")
|
70 |
-
DebertanoLORA_pipe = pipeline(
|
71 |
# DebertawithLORA_pipe = pipeline("text-classification",model=sa_merged_model2, tokenizer=bbu_tokenizer2)
|
72 |
|
73 |
#STS models
|
@@ -111,7 +111,7 @@ def displayMetricStatsText():
|
|
111 |
# Ttime = str(round(Ttime/60,2))
|
112 |
# print(Ttime)
|
113 |
|
114 |
-
metrics = ("Active Training Time:
|
115 |
for i in range(0, len(loss_data)):
|
116 |
metrics = metrics + 'Epoch Number: ' + str(i) + '\n'
|
117 |
metrics = metrics + 'Accuracy (%): ' + str(round(accuracy_data[i].value * 100, 3)) + '\n'
|
@@ -143,7 +143,7 @@ def displayMetricStatsTextTCLora():
|
|
143 |
# Ttime = str(round(Ttime/60,2))
|
144 |
# print(event_acc.Tags())
|
145 |
|
146 |
-
metrics = ("Active Training Time:
|
147 |
for i in range(0, len(loss_data)):
|
148 |
metrics = metrics + 'Epoch Number: ' + str(i) + '\n'
|
149 |
metrics = metrics + 'Accuracy (%): ' + str(round(accuracy_data[i].value * 100, 3)) + '\n'
|
@@ -166,7 +166,7 @@ def displayMetricStatsTextNLINoLora():
|
|
166 |
event_acc.Reload()
|
167 |
accuracy_data = event_acc.Scalars('eval/accuracy')
|
168 |
loss_data = event_acc.Scalars('eval/loss')
|
169 |
-
metrics =
|
170 |
for i in range(0, len(loss_data)):
|
171 |
metrics = metrics + 'Epoch Number: ' + str(i) + '\n'
|
172 |
metrics = metrics + 'Accuracy (%): ' + str(round(accuracy_data[i].value * 100, 3)) + '\n'
|
@@ -189,7 +189,7 @@ def displayMetricStatsTextNLILora():
|
|
189 |
event_acc.Reload()
|
190 |
accuracy_data = event_acc.Scalars('eval/accuracy')
|
191 |
loss_data = event_acc.Scalars('eval/loss')
|
192 |
-
metrics =
|
193 |
for i in range(0, len(loss_data)):
|
194 |
metrics = metrics + 'Epoch Number: ' + str(i) + '\n'
|
195 |
metrics = metrics + 'Accuracy (%): ' + str(round(accuracy_data[i].value * 100, 3)) + '\n'
|
@@ -198,7 +198,8 @@ def displayMetricStatsTextNLILora():
|
|
198 |
return metrics
|
199 |
|
200 |
def displayMetricStatsTextSTSLora():
|
201 |
-
file_name = 'events.out.tfevents.STS-Lora.2'
|
|
|
202 |
event_acc = event_accumulator.EventAccumulator(file_name,
|
203 |
size_guidance={
|
204 |
event_accumulator.COMPRESSED_HISTOGRAMS: 500,
|
@@ -211,7 +212,7 @@ def displayMetricStatsTextSTSLora():
|
|
211 |
event_acc.Reload()
|
212 |
accuracy_data = event_acc.Scalars('eval/accuracy')
|
213 |
loss_data = event_acc.Scalars('eval/loss')
|
214 |
-
metrics =
|
215 |
for i in range(0, len(loss_data)):
|
216 |
metrics = metrics + 'Epoch Number: ' + str(i) + '\n'
|
217 |
metrics = metrics + 'Accuracy (%): ' + str(round(accuracy_data[i].value * 100, 3)) + '\n'
|
@@ -233,7 +234,7 @@ def displayMetricStatsTextSTSNoLora():
|
|
233 |
event_acc.Reload()
|
234 |
accuracy_data = event_acc.Scalars('eval/accuracy')
|
235 |
loss_data = event_acc.Scalars('eval/loss')
|
236 |
-
metrics =
|
237 |
for i in range(0, len(loss_data)):
|
238 |
metrics = metrics + 'Epoch Number: ' + str(i) + '\n'
|
239 |
metrics = metrics + 'Accuracy (%): ' + str(round(accuracy_data[i].value * 100, 3)) + '\n'
|
@@ -365,8 +366,8 @@ with gr.Blocks(
|
|
365 |
nli_p2 = gr.Textbox(placeholder="Prompt Two",label= "Enter Query")
|
366 |
nli_btn = gr.Button("Run")
|
367 |
btnNLIStats = gr.Button("Display Training Metrics")
|
368 |
-
btnTensorLinkNLICon = gr.Button(value="View Conventional Training Graphs", link="https://huggingface.co/
|
369 |
-
btnTensorLinkNLILora = gr.Button(value="View LoRA Training Graphs", link="")
|
370 |
gr.Examples(
|
371 |
[
|
372 |
"I am with my friends",
|
@@ -425,7 +426,7 @@ with gr.Blocks(
|
|
425 |
sts_btn = gr.Button("Run")
|
426 |
btnSTSStats = gr.Button("Display Training Metrics")
|
427 |
btnTensorLinkSTSCon = gr.Button(value="View Conventional Training Graphs", link="https://huggingface.co/rajevan123/STS-Conventional-Fine-Tuning/tensorboard")
|
428 |
-
btnTensorLinkSTSLora = gr.Button(value="View Lora Training Graphs", link="")
|
429 |
gr.Examples(
|
430 |
[
|
431 |
"the ball is green",
|
|
|
60 |
|
61 |
|
62 |
# Handle calls to Deberta--------------------------------------------
|
63 |
+
# base_model2 = DebertaForSequenceClassification.from_pretrained("microsoft/deberta-v3-xsmall", ignore_mismatched_sizes=True)
|
64 |
# peft_model_id2 = "rajevan123/STS-Lora-Fine-Tuning-Capstone-Deberta-old-model-pipe-test_augmentation"
|
65 |
# model2 = PeftModel.from_pretrained(model=base_model2, model_id=peft_model_id2)
|
66 |
# sa_merged_model2 = model2.merge_and_unload()
|
67 |
# bbu_tokenizer2 = AutoTokenizer.from_pretrained("microsoft/deberta-v3-xsmall")
|
68 |
|
69 |
DebertaUntrained_pipe = pipeline("text-classification", model="microsoft/deberta-v3-xsmall")
|
70 |
+
DebertanoLORA_pipe = pipeline(model="rajevan123/STS-Conventional-Fine-Tuning")
|
71 |
# DebertawithLORA_pipe = pipeline("text-classification",model=sa_merged_model2, tokenizer=bbu_tokenizer2)
|
72 |
|
73 |
#STS models
|
|
|
111 |
# Ttime = str(round(Ttime/60,2))
|
112 |
# print(Ttime)
|
113 |
|
114 |
+
metrics = ("Active Training Time: 27.95 mins \n\n")
|
115 |
for i in range(0, len(loss_data)):
|
116 |
metrics = metrics + 'Epoch Number: ' + str(i) + '\n'
|
117 |
metrics = metrics + 'Accuracy (%): ' + str(round(accuracy_data[i].value * 100, 3)) + '\n'
|
|
|
143 |
# Ttime = str(round(Ttime/60,2))
|
144 |
# print(event_acc.Tags())
|
145 |
|
146 |
+
metrics = ("Active Training Time: 15.58 mins \n\n")
|
147 |
for i in range(0, len(loss_data)):
|
148 |
metrics = metrics + 'Epoch Number: ' + str(i) + '\n'
|
149 |
metrics = metrics + 'Accuracy (%): ' + str(round(accuracy_data[i].value * 100, 3)) + '\n'
|
|
|
166 |
event_acc.Reload()
|
167 |
accuracy_data = event_acc.Scalars('eval/accuracy')
|
168 |
loss_data = event_acc.Scalars('eval/loss')
|
169 |
+
metrics = "Active Training Time: 6.74 mins \n\n"
|
170 |
for i in range(0, len(loss_data)):
|
171 |
metrics = metrics + 'Epoch Number: ' + str(i) + '\n'
|
172 |
metrics = metrics + 'Accuracy (%): ' + str(round(accuracy_data[i].value * 100, 3)) + '\n'
|
|
|
189 |
event_acc.Reload()
|
190 |
accuracy_data = event_acc.Scalars('eval/accuracy')
|
191 |
loss_data = event_acc.Scalars('eval/loss')
|
192 |
+
metrics = "Active Training Time: 15.04 mins \n\n"
|
193 |
for i in range(0, len(loss_data)):
|
194 |
metrics = metrics + 'Epoch Number: ' + str(i) + '\n'
|
195 |
metrics = metrics + 'Accuracy (%): ' + str(round(accuracy_data[i].value * 100, 3)) + '\n'
|
|
|
198 |
return metrics
|
199 |
|
200 |
def displayMetricStatsTextSTSLora():
|
201 |
+
#file_name = 'events.out.tfevents.STS-Lora.2'
|
202 |
+
file_name = hf_hub_download(repo_id="rajevan123/STS-Lora-Fine-Tuning-Capstone-Deberta-old-model-pipe-test_augmentation", filename="runs/Mar22_01-18-51_cf09826f8502/events.out.tfevents.1711070335.cf09826f8502.1294.0")
|
203 |
event_acc = event_accumulator.EventAccumulator(file_name,
|
204 |
size_guidance={
|
205 |
event_accumulator.COMPRESSED_HISTOGRAMS: 500,
|
|
|
212 |
event_acc.Reload()
|
213 |
accuracy_data = event_acc.Scalars('eval/accuracy')
|
214 |
loss_data = event_acc.Scalars('eval/loss')
|
215 |
+
metrics = "Active Training Time: 17.01 mins \n\n"
|
216 |
for i in range(0, len(loss_data)):
|
217 |
metrics = metrics + 'Epoch Number: ' + str(i) + '\n'
|
218 |
metrics = metrics + 'Accuracy (%): ' + str(round(accuracy_data[i].value * 100, 3)) + '\n'
|
|
|
234 |
event_acc.Reload()
|
235 |
accuracy_data = event_acc.Scalars('eval/accuracy')
|
236 |
loss_data = event_acc.Scalars('eval/loss')
|
237 |
+
metrics = "Active Training Time: 23.96 mins \n\n"
|
238 |
for i in range(0, len(loss_data)):
|
239 |
metrics = metrics + 'Epoch Number: ' + str(i) + '\n'
|
240 |
metrics = metrics + 'Accuracy (%): ' + str(round(accuracy_data[i].value * 100, 3)) + '\n'
|
|
|
366 |
nli_p2 = gr.Textbox(placeholder="Prompt Two",label= "Enter Query")
|
367 |
nli_btn = gr.Button("Run")
|
368 |
btnNLIStats = gr.Button("Display Training Metrics")
|
369 |
+
btnTensorLinkNLICon = gr.Button(value="View Conventional Training Graphs", link="https://huggingface.co/m4faisal/NLI-Conventional-Fine-Tuning/tensorboard")
|
370 |
+
btnTensorLinkNLILora = gr.Button(value="View LoRA Training Graphs", link="https://huggingface.co/m4faisal/NLI-Lora-Fine-Tuning-10K/tensorboard")
|
371 |
gr.Examples(
|
372 |
[
|
373 |
"I am with my friends",
|
|
|
426 |
sts_btn = gr.Button("Run")
|
427 |
btnSTSStats = gr.Button("Display Training Metrics")
|
428 |
btnTensorLinkSTSCon = gr.Button(value="View Conventional Training Graphs", link="https://huggingface.co/rajevan123/STS-Conventional-Fine-Tuning/tensorboard")
|
429 |
+
btnTensorLinkSTSLora = gr.Button(value="View Lora Training Graphs", link="https://huggingface.co/rajevan123/STS-Lora-Fine-Tuning-Capstone-Deberta-old-model-pipe-test_augmentation/tensorboard")
|
430 |
gr.Examples(
|
431 |
[
|
432 |
"the ball is green",
|