Spaces:
Sleeping
Sleeping
Commit ·
45abe90
1
Parent(s): 67709a4
Update tag_vocab file path
Browse files- tag_vocab.pkl → Nested/tag_vocab.pkl +0 -0
- app.py +6 -7
tag_vocab.pkl → Nested/tag_vocab.pkl
RENAMED
|
File without changes
|
app.py
CHANGED
|
@@ -10,19 +10,18 @@ app = FastAPI()
|
|
| 10 |
print("Version 2...")
|
| 11 |
|
| 12 |
# Download files from model repo
|
| 13 |
-
tag_vocab_path = hf_hub_download(
|
| 14 |
-
repo_id="SinaLab/Nested",
|
| 15 |
-
filename="tag_vocab.pkl"
|
| 16 |
-
)
|
| 17 |
|
| 18 |
checkpoint_path = hf_hub_download(
|
| 19 |
repo_id="SinaLab/Nested",
|
| 20 |
filename="checkpoints/checkpoint_2.pt"
|
| 21 |
)
|
| 22 |
-
|
| 23 |
-
print("checkpoint_path: ", checkpoint_path)
|
| 24 |
# Load model
|
| 25 |
-
with open(
|
| 26 |
id2label = pickle.load(f)
|
| 27 |
|
| 28 |
model = torch.load(checkpoint_path, map_location="cpu")
|
|
|
|
| 10 |
print("Version 2...")
|
| 11 |
|
| 12 |
# Download files from model repo
|
| 13 |
+
# tag_vocab_path = hf_hub_download(
|
| 14 |
+
# repo_id="SinaLab/Nested",
|
| 15 |
+
# filename="tag_vocab.pkl"
|
| 16 |
+
# )
|
| 17 |
|
| 18 |
checkpoint_path = hf_hub_download(
|
| 19 |
repo_id="SinaLab/Nested",
|
| 20 |
filename="checkpoints/checkpoint_2.pt"
|
| 21 |
)
|
| 22 |
+
|
|
|
|
| 23 |
# Load model
|
| 24 |
+
with open("Nested/tag_vocab.pkl", "rb") as f:
|
| 25 |
id2label = pickle.load(f)
|
| 26 |
|
| 27 |
model = torch.load(checkpoint_path, map_location="cpu")
|