-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add StableLM-3B 4E1T to Keras Hub #2151
base: master
Are you sure you want to change the base?
Conversation
@divyashreepathihalli Here is a comparison of numerics with Hugging Face in Colab. The results match with an absolute tolerance of 1e-3, but they do not match when using 1e-5. Could you please take a look and suggest some improvements or explanations for this discrepancy? |
with StableLM's official configuration(https://github.com/Stability-AI/StableLM/blob/main/configs/stablelm-3b-4e1t.yml). | ||
|
||
Args: | ||
num_query_heads (int): Number of attention heads for queries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
format type hints similar to other models
StableLM model with any number of layers, heads, and embedding dimensions. | ||
|
||
Args: | ||
vocabulary_size (int): The size of the token vocabulary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix type hint format
|
||
@keras_hub_export("keras_hub.models.StableLMBackbone") | ||
class StableLMBackbone(Backbone): | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first one line description should be immediately after """
|
||
Example: | ||
```python | ||
# Randomly initialized StableLM decoder with custom config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a from preset example
`keras.distribution.LayoutMap` that contains the sharding spec | ||
for all the model weights. | ||
""" | ||
# The weight path and shape of the Llama backbone is like below |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented code
This PR adds the StableLM-3B 4E1T model to Keras Hub. However, numerical matching with the Hugging Face implementation is still in progress.