Update app.py
Browse files
app.py
CHANGED
@@ -31,7 +31,7 @@ torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
|
|
31 |
OLMOASR_REPO = "allenai/OLMoASR" # Temporary model link as requested
|
32 |
CHECKPOINT_FILENAME = "OLMoASR-tiny.en.pt" # Adjust based on actual filename in the repo
|
33 |
LOCAL_CHECKPOINT_DIR = "checkpoints"
|
34 |
-
HF_MODEL_DIR = "
|
35 |
|
36 |
|
37 |
def ensure_checkpoint_dir():
|
@@ -122,9 +122,9 @@ def convert_checkpoint_to_hf(checkpoint_path):
|
|
122 |
def initialize_models():
|
123 |
"""Initialize both HuggingFace and OLMoASR models."""
|
124 |
# Download and convert HuggingFace model
|
125 |
-
checkpoint_path = download_olmoasr_checkpoint()
|
126 |
-
hf_model_path = convert_checkpoint_to_hf(checkpoint_path)
|
127 |
-
olmoasr_ckpt =
|
128 |
|
129 |
# Load HuggingFace model
|
130 |
hf_model = AutoModelForSpeechSeq2Seq.from_pretrained(
|
|
|
31 |
OLMOASR_REPO = "allenai/OLMoASR" # Temporary model link as requested
|
32 |
CHECKPOINT_FILENAME = "OLMoASR-tiny.en.pt" # Adjust based on actual filename in the repo
|
33 |
LOCAL_CHECKPOINT_DIR = "checkpoints"
|
34 |
+
HF_MODEL_DIR = "tiny_hf"
|
35 |
|
36 |
|
37 |
def ensure_checkpoint_dir():
|
|
|
122 |
def initialize_models():
|
123 |
"""Initialize both HuggingFace and OLMoASR models."""
|
124 |
# Download and convert HuggingFace model
|
125 |
+
#checkpoint_path = download_olmoasr_checkpoint()
|
126 |
+
#hf_model_path = convert_checkpoint_to_hf(checkpoint_path)
|
127 |
+
olmoasr_ckpt = HF_MODEL_DIR
|
128 |
|
129 |
# Load HuggingFace model
|
130 |
hf_model = AutoModelForSpeechSeq2Seq.from_pretrained(
|