Update app.py
Browse files
app.py
CHANGED
|
@@ -29,8 +29,8 @@ torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
|
|
| 29 |
|
| 30 |
# Configuration for model download and conversion
|
| 31 |
OLMOASR_REPO = "allenai/OLMoASR" # Temporary model link as requested
|
| 32 |
-
CHECKPOINT_FILENAME = "
|
| 33 |
-
LOCAL_CHECKPOINT_DIR = "
|
| 34 |
HF_MODEL_DIR = "tiny_hf"
|
| 35 |
|
| 36 |
|
|
@@ -124,7 +124,8 @@ def initialize_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(
|
|
|
|
| 29 |
|
| 30 |
# Configuration for model download and conversion
|
| 31 |
OLMOASR_REPO = "allenai/OLMoASR" # Temporary model link as requested
|
| 32 |
+
CHECKPOINT_FILENAME = "tiny.en.pt" # Adjust based on actual filename in the repo
|
| 33 |
+
LOCAL_CHECKPOINT_DIR = "checkpoint_tiny"
|
| 34 |
HF_MODEL_DIR = "tiny_hf"
|
| 35 |
|
| 36 |
|
|
|
|
| 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 = os.path.join(LOCAL_CHECKPOINT_DIR, CHECKPOINT_FILENAME)
|
| 128 |
+
hf_model_path = HF_MODEL_DIR
|
| 129 |
|
| 130 |
# Load HuggingFace model
|
| 131 |
hf_model = AutoModelForSpeechSeq2Seq.from_pretrained(
|