Kuuhaakuu commited on
Commit
c28954e
1 Parent(s): 46b68f5
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -5,13 +5,13 @@ import random
5
  import matplotlib.pyplot as plt
6
 
7
  # Load transcription results
8
- with open("./drive/MyDrive/results/gradio_results.json", "r", encoding='utf-8') as file:
9
  gradio_transcriptions = json.load(file)
10
 
11
- with open("./drive/MyDrive/results/openai_results.json", "r", encoding='utf-8') as file:
12
  openai_transcriptions = json.load(file)
13
 
14
- audio_files_directory = "./drive/MyDrive/chunks"
15
 
16
  def get_random_audio_and_transcriptions():
17
  random_choice = random.choice(os.listdir(audio_files_directory))
@@ -22,7 +22,7 @@ def get_random_audio_and_transcriptions():
22
  return audio_path, gradio_transcription, openai_transcription
23
 
24
  def handle_vote(vote, audio_path, gradio_transcription, openai_transcription):
25
- votes_file = "./drive/MyDrive/results/votes.json"
26
 
27
  # Ensure vote key is in lowercase to match dictionary keys
28
  vote = vote.lower()
@@ -46,7 +46,7 @@ def handle_vote(vote, audio_path, gradio_transcription, openai_transcription):
46
  json.dump(votes, file, indent=4)
47
 
48
  def calculate_vote_totals():
49
- votes_file = "./drive/MyDrive/results/votes.json"
50
  if os.path.exists(votes_file):
51
  with open(votes_file, "r", encoding='utf-8') as file:
52
  votes_data = json.load(file)
 
5
  import matplotlib.pyplot as plt
6
 
7
  # Load transcription results
8
+ with open("./results/gradio_results.json", "r", encoding='utf-8') as file:
9
  gradio_transcriptions = json.load(file)
10
 
11
+ with open("./results/openai_results.json", "r", encoding='utf-8') as file:
12
  openai_transcriptions = json.load(file)
13
 
14
+ audio_files_directory = "./chunks"
15
 
16
  def get_random_audio_and_transcriptions():
17
  random_choice = random.choice(os.listdir(audio_files_directory))
 
22
  return audio_path, gradio_transcription, openai_transcription
23
 
24
  def handle_vote(vote, audio_path, gradio_transcription, openai_transcription):
25
+ votes_file = "./results/votes.json"
26
 
27
  # Ensure vote key is in lowercase to match dictionary keys
28
  vote = vote.lower()
 
46
  json.dump(votes, file, indent=4)
47
 
48
  def calculate_vote_totals():
49
+ votes_file = "./results/votes.json"
50
  if os.path.exists(votes_file):
51
  with open(votes_file, "r", encoding='utf-8') as file:
52
  votes_data = json.load(file)