Aaaapril4
commited on
Commit
·
cc617f6
1
Parent(s):
0e684e9
update
Browse files- upload_to_hf.py +0 -20
upload_to_hf.py
CHANGED
|
@@ -32,8 +32,6 @@ PhaseNet-TF is an advanced deep learning model for automatic seismic phase picki
|
|
| 32 |
- **Spectrogram Size**: 64 × 4800 (frequency × time)
|
| 33 |
- **Input Channels**: 6 (3 real + 3 imaginary spectrogram channels)
|
| 34 |
- **Output Classes**: 4 (noise, P, S, PS)
|
| 35 |
-
|
| 36 |
-
## Load the checkpoint
|
| 37 |
"""
|
| 38 |
|
| 39 |
def create_config_json(model_path, version=None):
|
|
@@ -96,20 +94,6 @@ This repository contains two versions of the PhaseNet-TF Alaska model:
|
|
| 96 |
- **Config**: `config_iter2.json`
|
| 97 |
- **Documentation**: [README_iter2.md](README_iter2.md)
|
| 98 |
|
| 99 |
-
## Quick Start
|
| 100 |
-
|
| 101 |
-
### Load Iteration 1
|
| 102 |
-
```python
|
| 103 |
-
import torch
|
| 104 |
-
checkpoint = torch.load("pytorch_model_iter1.bin", map_location="cpu")
|
| 105 |
-
```
|
| 106 |
-
|
| 107 |
-
### Load Iteration 2
|
| 108 |
-
```python
|
| 109 |
-
import torch
|
| 110 |
-
checkpoint = torch.load("pytorch_model_iter2.bin", map_location="cpu")
|
| 111 |
-
```
|
| 112 |
-
|
| 113 |
## Model Architecture
|
| 114 |
|
| 115 |
- **Backbone**: DeepLabV3Plus with ResNet34 encoder
|
|
@@ -226,10 +210,6 @@ def upload_model_to_hf(
|
|
| 226 |
|
| 227 |
# Create and upload README.md
|
| 228 |
model_card = create_model_card(version)
|
| 229 |
-
if version:
|
| 230 |
-
model_card += f'checkpoint = torch.load("pytorch_model_{version}.bin", map_location="cpu")'
|
| 231 |
-
else:
|
| 232 |
-
model_card += 'checkpoint = torch.load("pytorch_model.bin", map_location="cpu")'
|
| 233 |
|
| 234 |
model_card += """
|
| 235 |
|
|
|
|
| 32 |
- **Spectrogram Size**: 64 × 4800 (frequency × time)
|
| 33 |
- **Input Channels**: 6 (3 real + 3 imaginary spectrogram channels)
|
| 34 |
- **Output Classes**: 4 (noise, P, S, PS)
|
|
|
|
|
|
|
| 35 |
"""
|
| 36 |
|
| 37 |
def create_config_json(model_path, version=None):
|
|
|
|
| 94 |
- **Config**: `config_iter2.json`
|
| 95 |
- **Documentation**: [README_iter2.md](README_iter2.md)
|
| 96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
## Model Architecture
|
| 98 |
|
| 99 |
- **Backbone**: DeepLabV3Plus with ResNet34 encoder
|
|
|
|
| 210 |
|
| 211 |
# Create and upload README.md
|
| 212 |
model_card = create_model_card(version)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 213 |
|
| 214 |
model_card += """
|
| 215 |
|