README / README.md
merve's picture
merve HF staff
Update README.md
c103e6a
|
raw
history blame
2.2 kB
---
title: README
emoji: ❤️
colorFrom: red
colorTo: red
sdk: streamlit
app_file: app.py
pinned: false
---
<p class="lg:col-span-3">
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 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/name-of-model")
</pre>
</div>
</p>
<div class="lg:col-span-3">
<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 as TensorboardCallback
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>