jeanq1 commited on
Commit
ffa28f6
·
verified ·
1 Parent(s): 45bc5b2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +23 -3
README.md CHANGED
@@ -1,8 +1,28 @@
1
  ---
2
  license: mit
3
  ---
4
- Model can be reloaded with the following code snippet:
 
 
 
 
 
 
 
 
5
  import torch
6
  from huggingface_hub import hf_hub_download
7
- p = hf_hub_download("jeanq1/experiment_pel", filename="model.ckpt", local_dir="./weights")
8
- ckpt = torch.load(p, map_location="cpu", weights_only=False) # use it like any local file (modifié)
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
  ---
4
+
5
+ # experiment_pel
6
+
7
+ A simple **PyTorch checkpoint** published for reproducible experiments.
8
+ This repository exposes a single file `model.ckpt` (raw PyTorch/Lightning-style checkpoint). It is **not** a Transformers model; load it with `torch.load`.
9
+
10
+ ## Usage
11
+
12
+ ```python
13
  import torch
14
  from huggingface_hub import hf_hub_download
15
+
16
+ # Download the checkpoint into a local folder (or use the default cache)
17
+ p = hf_hub_download(
18
+ repo_id="jeanq1/experiment_pel",
19
+ filename="model.ckpt",
20
+ local_dir="./weights", # optional: place a copy/symlink here
21
+ local_dir_use_symlinks=False # set to True to keep a symlink instead of a copy
22
+ )
23
+
24
+ # Load like any local PyTorch file
25
+ ckpt = torch.load(p, map_location="cpu", weights_only=False)
26
+ # Example:
27
+ # model = YourModelClass(...)
28
+ # model.load_state_dict(ckpt["state_dict"] if "state_dict" in ckpt else ckpt)