mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
push folder restructuring
This commit is contained in:
15
scripts/clear_artefacts.sh
Executable file
15
scripts/clear_artefacts.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Directory to search for Python files
|
||||
directory="."
|
||||
|
||||
# Pattern to match Python files (e.g., "*.py" for all .py files)
|
||||
text_file_pattern="transcript_*.txt"
|
||||
pickle_file_pattern="*.pkl"
|
||||
html_file_pattern="*.html"
|
||||
png_file_pattern="*.png"
|
||||
|
||||
find "$directory" -type f -name "$text_file_pattern" -delete
|
||||
find "$directory" -type f -name "$pickle_file_pattern" -delete
|
||||
find "$directory" -type f -name "$html_file_pattern" -delete
|
||||
find "$directory" -type f -name "$png_file_pattern" -delete
|
||||
@@ -26,7 +26,7 @@ pip install git+https://github.com/sanchit-gandhi/whisper-jax.git
|
||||
# Update to latest version
|
||||
pip install --upgrade --no-deps --force-reinstall git+https://github.com/sanchit-gandhi/whisper-jax.git
|
||||
|
||||
pip install -r requirements.txt
|
||||
pip install -r ../requirements.txt
|
||||
|
||||
# download spacy models
|
||||
spacy download en_core_web_sm
|
||||
@@ -15,7 +15,7 @@ from aiortc.contrib.media import MediaRelay
|
||||
from av import AudioFifo
|
||||
from whisper_jax import FlaxWhisperPipline
|
||||
|
||||
from reflector.utils.server_utils import run_in_executor
|
||||
from utils.server_utils import run_in_executor
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ def create_wordcloud(timestamp, real_time=False):
|
||||
else:
|
||||
filename += "_" + timestamp.strftime("%m-%d-%Y_%H:%M:%S") + ".txt"
|
||||
|
||||
with open(filename, "r") as f:
|
||||
with open("./artefacts/" + filename, "r") as f:
|
||||
transcription_text = f.read()
|
||||
|
||||
# python_mask = np.array(PIL.Image.open("download1.png"))
|
||||
@@ -199,6 +199,6 @@ def create_talk_diff_scatter_viz(timestamp, real_time=False):
|
||||
transform=st.Scalers.dense_rank
|
||||
)
|
||||
if real_time:
|
||||
open('./real_time_scatter_' + timestamp.strftime("%m-%d-%Y_%H:%M:%S") + '.html', 'w').write(html)
|
||||
open('./artefacts/real_time_scatter_' + timestamp.strftime("%m-%d-%Y_%H:%M:%S") + '.html', 'w').write(html)
|
||||
else:
|
||||
open('./scatter_' + timestamp.strftime("%m-%d-%Y_%H:%M:%S") + '.html', 'w').write(html)
|
||||
open('./artefacts/scatter_' + timestamp.strftime("%m-%d-%Y_%H:%M:%S") + '.html', 'w').write(html)
|
||||
@@ -137,10 +137,10 @@ def main():
|
||||
for chunk in whisper_result["chunks"]:
|
||||
transcript_text += chunk["text"]
|
||||
|
||||
with open("transcript_" + NOW.strftime("%m-%d-%Y_%H:%M:%S") + ".txt", "w") as transcript_file:
|
||||
with open("./artefacts/transcript_" + NOW.strftime("%m-%d-%Y_%H:%M:%S") + ".txt", "w") as transcript_file:
|
||||
transcript_file.write(transcript_text)
|
||||
|
||||
with open("transcript_with_timestamp_" + NOW.strftime("%m-%d-%Y_%H:%M:%S") + ".txt", "w") as transcript_file_timestamps:
|
||||
with open("./artefacts/transcript_with_timestamp_" + NOW.strftime("%m-%d-%Y_%H:%M:%S") + ".txt", "w") as transcript_file_timestamps:
|
||||
transcript_file_timestamps.write(str(whisper_result))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user