Spaces:
Sleeping
Sleeping
Create model_upload
Browse files- model_upload +15 -0
model_upload
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from huggingface_hub import login
|
2 |
+
|
3 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
4 |
+
|
5 |
+
|
6 |
+
# Login to your Hugging Face account
|
7 |
+
login(token="add api token")
|
8 |
+
|
9 |
+
# Load the fine-tuned model and tokenizer
|
10 |
+
model = AutoModelForCausalLM.from_pretrained("/kaggle/working/finetuned_model")
|
11 |
+
tokenizer = AutoTokenizer.from_pretrained("/kaggle/working/finetuned_tokenizer")
|
12 |
+
|
13 |
+
# Replace 'your-username/finetuned-model' with your Hugging Face username and desired model name
|
14 |
+
model.push_to_hub("rahul7star/zero-ai-model")
|
15 |
+
tokenizer.push_to_hub("rahul7star/zero-ai-model")
|