File size: 4,272 Bytes
17bfa78
 
cce3967
 
 
17bfa78
 
 
 
 
a48faf2
 
fa537b7
b9e2c00
 
 
360006a
e06f31d
ede89a8
a48faf2
e06f31d
b001ae7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2466dfe
b001ae7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7666174
ede89a8
a225cab
ede89a8
 
 
a90db2d
ede89a8
 
 
 
 
 
3faa42a
ede89a8
 
425f31f
ede89a8
 
3faa42a
425f31f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7cc5fb4
3faa42a
 
 
 
 
 
 
 
 
 
 
 
 
 
5a58d64
3faa42a
5a58d64
3faa42a
 
5a58d64
 
 
3faa42a
 
 
 
 
f142df9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
---
title: README
emoji: ❤️
colorFrom: red
colorTo: red
sdk: streamlit
app_file: app.py
pinned: false
---

<div class="lg:col-span-3">
	<p class="mb-4">
	Hugging Face makes it easy to collaboratively build and showcase your <a
		href="https://keras.io">Keras</a
	>
	models!<br />
You can collaborate with your organization, upload and showcase your own models in your profile, or join us in this organization to demo Keras examples! ❤️

</p>
</div>

<a href="https://keras.io/" class="block overflow-hidden group">
	<div
		class="w-full h-40 object-cover mb-2 rounded-lg flex items-center justify-center bg-[#FA8072]"
	>
		<img alt="" src="https://huggingface.co/spaces/keras-io/README/resolve/main/keras-filter.png" class="w-40" />
	</div>
	<div class="underline">Keras.io</div>
</a>
<a
	href="https://github.com/huggingface/huggingface_hub/blob/1f83ed230932128fba8bfe2a7f0c78df66e6e3ee/src/huggingface_hub/keras_mixin.py#L60"
	class="block overflow-hidden group"
>
	<div
		class="w-full h-40 mb-2 bg-gray-900 group-hover:bg-gray-850 rounded-lg flex items-start justify-start overflow-hidden"
	>
		<img
			alt=""
			src="https://huggingface.co/spaces/keras-io/README/resolve/main/push_to_hub.png"
			class="w-full h-40 object-cover overflow-hidden"
		/>
	</div>
	<div class="underline">Push your Keras models to Hub ❤️ </div>
</a>
<a
	href="https://huggingface.co/models?library=keras&sort=downloads"
	class="block overflow-hidden group"
>
	<div
		class="w-full h-40 mb-2 bg-gray-900 group-hover:bg-gray-850 rounded-lg flex items-start justify-start overflow-hidden"
	>
		<img
			alt=""
			src="https://huggingface.co/spaces/keras-io/README/resolve/main/keras-hf.png"
			class="w-full h-40 object-cover overflow-hidden"
		/>
	</div>
	<div class="underline">Find all Keras models on the 🤗 Hub</div>
</a>


<div class="lg:col-span-3">
	<p class="mb-4">
		To upload your Keras models to the Hub, you can use the <a
			href="https://github.com/huggingface/huggingface_hub/blob/1f83ed230932128fba8bfe2a7f0c78df66e6e3ee/src/huggingface_hub/keras_mixin.py#L60"
			>push_to_hub_keras</a
		>
		function.
	</p>
	<div
		class="p-4 bg-gradient-to-b from-gray-50-to-white border border-gray-100 rounded-lg relative mb-4"
	>
		<pre
			class="break-words leading-1 whitespace-pre-line text-xs md:text-sm text-gray-800">
!pip install huggingface-hub
!huggingface-cli login
from huggingface_hub.keras_mixin import push_to_hub_keras
push_to_hub_keras(model = model, repo_url = "https://huggingface.co/your-username/your-awesome-model")
	</pre>
	</div>
</p>
<div class="lg:col-span-3">
	<p class="mb-4">
		To load Keras models from the 🤗Hub, use <a
			href="https://github.com/huggingface/huggingface_hub/blob/d3ba39a69bb5570eb7f31ce76a19b53fdc89728b/src/huggingface_hub/keras_mixin.py#L56"
			>from_pretrained_keras</a
		>
		function.
	</p>
	<div
		class="p-4 bg-gradient-to-b from-gray-50-to-white border border-gray-100 rounded-lg relative mb-4"
	>
		<pre
			class="break-words leading-1 whitespace-pre-line text-xs md:text-sm text-gray-800">
!pip install huggingface-hub
!huggingface-cli login
from huggingface_hub.keras_mixin import from_pretrained_keras
from_pretrained_keras("your-username/your-awesome-model)
	</pre>
	</div>
<div class="lg:col-span-1">
	<p class="mb-4">
		If you'd like to upload 🤗Transformers based Keras checkpoints and let us host your metrics interactively in the repo in with TensorBoard, use <a
			href="https://huggingface.co/transformers/v4.12.5/_modules/transformers/keras_callbacks.html#PushToHubCallback"
			>PushToHubCallback</a
		>
		like follows:
	</p>
	<div
		class="p-4 bg-gradient-to-b from-gray-50-to-white border border-gray-100 rounded-lg relative mb-4"
	>
		<pre
			class="break-words leading-1 whitespace-pre-line text-xs md:text-sm text-gray-800">
!pip install huggingface-hub
!huggingface-cli login

from transformers.keras_callbacks import PushToHubCallback
from tensorflow.keras.callbacks import TensorBoard
tensorboard_callback = TensorBoard(log_dir = "./logs/tensorboard)

push_to_hub_callback = PushToHubCallback(output_dir="./logs", 
										tokenizer=tokenizer,
										hub_model_id=model_id)

callbacks = [tensorboard_callback, push_to_hub_callback]
model.fit(..., callbacks=callbacks, ...)
	</pre>
	
</div>