Th3r0 commited on
Commit
77b5fba
1 Parent(s): 56ab5a8

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -8
app.py CHANGED
@@ -80,7 +80,8 @@ def displayMetricStatsUntrained():
80
  return "No statistics to display for untrained models"
81
 
82
  def displayMetricStatsText():
83
- file_name = 'events.out.tfevents.distilbertSA-conventional.0'
 
84
  event_acc = event_accumulator.EventAccumulator(file_name,
85
  size_guidance={
86
  event_accumulator.COMPRESSED_HISTOGRAMS: 500,
@@ -125,7 +126,8 @@ def displayMetricStatsTextTCLora():
125
  return metrics
126
 
127
  def displayMetricStatsTextNLINoLora():
128
- file_name = 'events.out.tfevents.NLI-Conventional.1'
 
129
  event_acc = event_accumulator.EventAccumulator(file_name,
130
  size_guidance={
131
  event_accumulator.COMPRESSED_HISTOGRAMS: 500,
@@ -190,7 +192,8 @@ def displayMetricStatsTextSTSLora():
190
 
191
  return metrics
192
  def displayMetricStatsTextSTSNoLora():
193
- file_name = 'events.out.tfevents.STS-Conventional.0'
 
194
  event_acc = event_accumulator.EventAccumulator(file_name,
195
  size_guidance={
196
  event_accumulator.COMPRESSED_HISTOGRAMS: 500,
@@ -253,7 +256,6 @@ def displayMetricStatsGraph():
253
  # response = ("1 to 10")
254
  # else:
255
  # response = ("whatever man whatever manwhatever manwhatever manwhatever manwhatever manwhatever manwhatever manwhatever manwhatever manwhatever manwhatever man")
256
-
257
  # history.append((message, response))
258
  # return history, history
259
 
@@ -287,7 +289,8 @@ with gr.Blocks(
287
  inp = gr.Textbox(placeholder="Prompt",label= "Enter Query")
288
  btn = gr.Button("Run")
289
  btnTextClassStats = gr.Button("Display Training Metrics")
290
- btnTensorLink = gr.Button(value="View Tensorboard Graphs", link="https://huggingface.co/Intradiction/text_classification_NoLORA/tensorboard")
 
291
  gr.Examples(
292
  [
293
  "I thought this was a bit contrived",
@@ -316,7 +319,7 @@ with gr.Blocks(
316
  btn.click(fn=distilBERTwithLORA_fn, inputs=inp, outputs=TextClassOut2)
317
  btnTextClassStats.click(fn=displayMetricStatsUntrained, outputs=TextClassUntrained)
318
  btnTextClassStats.click(fn=displayMetricStatsText, outputs=TextClassNoLoraStats)
319
- btnTextClassStats.click(fn=displayMetricStatsTextTCLora, outputs=TextClassLoraStats) #to be changed
320
 
321
  with gr.Tab("Natural Language Inferencing"):
322
  with gr.Row():
@@ -335,7 +338,8 @@ with gr.Blocks(
335
  nli_p2 = gr.Textbox(placeholder="Prompt Two",label= "Enter Query")
336
  nli_btn = gr.Button("Run")
337
  btnNLIStats = gr.Button("Display Training Metrics")
338
- btnTensorLink1 = gr.Button(value="View Tensorboard Graphs", link="https://huggingface.co/Intradiction/text_classification_NoLORA/tensorboard") #to be changed
 
339
  gr.Examples(
340
  [
341
  "I am with my friends",
@@ -393,7 +397,8 @@ with gr.Blocks(
393
  sts_p2 = gr.Textbox(placeholder="Prompt Two",label= "Enter Query")
394
  sts_btn = gr.Button("Run")
395
  btnSTSStats = gr.Button("Display Training Metrics")
396
- btnTensorLink2 = gr.Button(value="View Tensorboard Graphs", link="https://huggingface.co/Intradiction/text_classification_NoLORA/tensorboard") #to be changed
 
397
  gr.Examples(
398
  [
399
  "the ball is green",
 
80
  return "No statistics to display for untrained models"
81
 
82
  def displayMetricStatsText():
83
+ #file_name = 'events.out.tfevents.distilbertSA-conventional.0'
84
+ file_name = hf_hub_download(repo_id="Intradiction/text_classification_NoLORA", filename="runs/Nov28_21-52-51_81dc5cd53c46/events.out.tfevents.1701208378.81dc5cd53c46.1934.0")
85
  event_acc = event_accumulator.EventAccumulator(file_name,
86
  size_guidance={
87
  event_accumulator.COMPRESSED_HISTOGRAMS: 500,
 
126
  return metrics
127
 
128
  def displayMetricStatsTextNLINoLora():
129
+ #file_name = 'events.out.tfevents.NLI-Conventional.1'
130
+ file_name = hf_hub_download(repo_id="Intradiction/NLI-Conventional-Fine-Tuning", filename="runs/Feb15_15-44-46_d5fea890778d/events.out.tfevents.1708014218.d5fea890778d.473.1")
131
  event_acc = event_accumulator.EventAccumulator(file_name,
132
  size_guidance={
133
  event_accumulator.COMPRESSED_HISTOGRAMS: 500,
 
192
 
193
  return metrics
194
  def displayMetricStatsTextSTSNoLora():
195
+ #file_name = 'events.out.tfevents.STS-Conventional.0'
196
+ file_name = hf_hub_download(repo_id="rajevan123/STS-Conventional-Fine-Tuning", filename="runs/Mar15_15-21-09_020acc63b803/events.out.tfevents.1710516070.020acc63b803.414.0")
197
  event_acc = event_accumulator.EventAccumulator(file_name,
198
  size_guidance={
199
  event_accumulator.COMPRESSED_HISTOGRAMS: 500,
 
256
  # response = ("1 to 10")
257
  # else:
258
  # response = ("whatever man whatever manwhatever manwhatever manwhatever manwhatever manwhatever manwhatever manwhatever manwhatever manwhatever manwhatever man")
 
259
  # history.append((message, response))
260
  # return history, history
261
 
 
289
  inp = gr.Textbox(placeholder="Prompt",label= "Enter Query")
290
  btn = gr.Button("Run")
291
  btnTextClassStats = gr.Button("Display Training Metrics")
292
+ btnTensorLinkTCNoLora = gr.Button(value="View Conventional Training Graphs", link="https://huggingface.co/Intradiction/text_classification_NoLORA/tensorboard")
293
+ btnTensorLinkTCLora = gr.Button(value="View LoRA Training Graphs", link="https://huggingface.co/Intradiction/BERT-SA-LORA/tensorboard")
294
  gr.Examples(
295
  [
296
  "I thought this was a bit contrived",
 
319
  btn.click(fn=distilBERTwithLORA_fn, inputs=inp, outputs=TextClassOut2)
320
  btnTextClassStats.click(fn=displayMetricStatsUntrained, outputs=TextClassUntrained)
321
  btnTextClassStats.click(fn=displayMetricStatsText, outputs=TextClassNoLoraStats)
322
+ btnTextClassStats.click(fn=displayMetricStatsTextTCLora, outputs=TextClassLoraStats)
323
 
324
  with gr.Tab("Natural Language Inferencing"):
325
  with gr.Row():
 
338
  nli_p2 = gr.Textbox(placeholder="Prompt Two",label= "Enter Query")
339
  nli_btn = gr.Button("Run")
340
  btnNLIStats = gr.Button("Display Training Metrics")
341
+ btnTensorLinkNLICon = gr.Button(value="View Conventional Training Graphs", link="https://huggingface.co/Intradiction/NLI-Conventional-Fine-Tuning/tensorboard")
342
+ btnTensorLinkNLILora = gr.Button(value="View LoRA Training Graphs", link="")
343
  gr.Examples(
344
  [
345
  "I am with my friends",
 
397
  sts_p2 = gr.Textbox(placeholder="Prompt Two",label= "Enter Query")
398
  sts_btn = gr.Button("Run")
399
  btnSTSStats = gr.Button("Display Training Metrics")
400
+ btnTensorLinkSTSCon = gr.Button(value="View Conventional Training Graphs", link="https://huggingface.co/rajevan123/STS-Conventional-Fine-Tuning/tensorboard")
401
+ btnTensorLinkSTSLora = gr.Button(value="View Lora Training Graphs", link="")
402
  gr.Examples(
403
  [
404
  "the ball is green",