Spaces:
Running
Running
Update generate_transcript.py
Browse files- generate_transcript.py +5 -11
generate_transcript.py
CHANGED
|
@@ -6,7 +6,6 @@ import transformers
|
|
| 6 |
import pickle
|
| 7 |
from tqdm import tqdm
|
| 8 |
import warnings
|
| 9 |
-
import spaces
|
| 10 |
from groq import Groq
|
| 11 |
import os
|
| 12 |
|
|
@@ -18,7 +17,7 @@ class TranscriptProcessor:
|
|
| 18 |
A class to generate and rewrite podcast-style transcripts using a specified language model.
|
| 19 |
"""
|
| 20 |
|
| 21 |
-
def __init__(self, text_file_path, model_name="
|
| 22 |
"""
|
| 23 |
Initialize with the path to the cleaned text file and the model name.
|
| 24 |
|
|
@@ -27,16 +26,11 @@ class TranscriptProcessor:
|
|
| 27 |
model_name (str): Name of the language model to use.
|
| 28 |
"""
|
| 29 |
self.text_file_path = text_file_path
|
| 30 |
-
self.transcript_output_path =
|
| 31 |
-
self.tts_output_path =
|
| 32 |
self.model_name = model_name
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
"text-generation",
|
| 36 |
-
model=self.model_name,
|
| 37 |
-
model_kwargs={"torch_dtype": torch.bfloat16},
|
| 38 |
-
device_map="auto"
|
| 39 |
-
)
|
| 40 |
self.transcript_prompt = """
|
| 41 |
You are a world-class podcast writer, working as a ghost writer for top podcast hosts.
|
| 42 |
You will write the dialogue with engaging interruptions, anecdotes, and curiosity-led questions.
|
|
|
|
| 6 |
import pickle
|
| 7 |
from tqdm import tqdm
|
| 8 |
import warnings
|
|
|
|
| 9 |
from groq import Groq
|
| 10 |
import os
|
| 11 |
|
|
|
|
| 17 |
A class to generate and rewrite podcast-style transcripts using a specified language model.
|
| 18 |
"""
|
| 19 |
|
| 20 |
+
def __init__(self, text_file_path,transcript_output_path,tts_output_path, model_name="llama3-70b-8192"):
|
| 21 |
"""
|
| 22 |
Initialize with the path to the cleaned text file and the model name.
|
| 23 |
|
|
|
|
| 26 |
model_name (str): Name of the language model to use.
|
| 27 |
"""
|
| 28 |
self.text_file_path = text_file_path
|
| 29 |
+
self.transcript_output_path = transcript_output_path
|
| 30 |
+
self.tts_output_path = tts_output_path
|
| 31 |
self.model_name = model_name
|
| 32 |
+
|
| 33 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
self.transcript_prompt = """
|
| 35 |
You are a world-class podcast writer, working as a ghost writer for top podcast hosts.
|
| 36 |
You will write the dialogue with engaging interruptions, anecdotes, and curiosity-led questions.
|