Spaces:
Sleeping
Sleeping
Commit
·
3554c9a
1
Parent(s):
48c59e0
removed the model binary, will now use model from hugginface models repo
Browse files- app.py +3 -1
- model_bin.pt +0 -3
- requirements.txt +3 -2
app.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import torch
|
| 2 |
from transformers import AutoTokenizer
|
| 3 |
import gradio as gr
|
|
|
|
| 4 |
from model import LlamaForCausalLM # Import your custom model class
|
| 5 |
|
| 6 |
# Load tokenizer and model
|
|
@@ -17,7 +18,8 @@ model = LlamaForCausalLM(
|
|
| 17 |
num_heads=9
|
| 18 |
)
|
| 19 |
device = "cpu"
|
| 20 |
-
|
|
|
|
| 21 |
|
| 22 |
checkpoint = torch.load(checkpoint_path, map_location=device)
|
| 23 |
model.load_state_dict(checkpoint['model_state_dict'])
|
|
|
|
| 1 |
import torch
|
| 2 |
from transformers import AutoTokenizer
|
| 3 |
import gradio as gr
|
| 4 |
+
from huggingface_hub import hf_hub_download
|
| 5 |
from model import LlamaForCausalLM # Import your custom model class
|
| 6 |
|
| 7 |
# Load tokenizer and model
|
|
|
|
| 18 |
num_heads=9
|
| 19 |
)
|
| 20 |
device = "cpu"
|
| 21 |
+
model_id = "chbsaikiran/smollm2_135M_model"
|
| 22 |
+
checkpoint_path = hf_hub_download(repo_id=model_id, filename="model_bin.pt")
|
| 23 |
|
| 24 |
checkpoint = torch.load(checkpoint_path, map_location=device)
|
| 25 |
model.load_state_dict(checkpoint['model_state_dict'])
|
model_bin.pt
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:3a77b73f06315595be13616cb77bf4483955cd9e5c9f40176332feebf7d149e5
|
| 3 |
-
size 704502186
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
CHANGED
|
@@ -1,3 +1,4 @@
|
|
| 1 |
-
gradio
|
| 2 |
torch
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
torch
|
| 2 |
+
gradio
|
| 3 |
+
transformers
|
| 4 |
+
huggingface_hub
|