File size: 1,114 Bytes
7c72fe7 7962b5e 7c72fe7 7962b5e 00b24a5 7962b5e |
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 |
---
library_name: transformers
license: apache-2.0
---
# Model Card for Model ID
<!-- Provide a quick summary of what the model is/does. -->
## Model Details
Created using
```python
from transformers import LlamaTokenizer, LlamaForCausalLM
# Specify the model name or path from the Hugging Face Hub
org_in = "BEE-spoke-data/"
org_out = "baseten/"
model_name = "smol_llama-101M-GQA"
embedding = False
embedding_name = "embedding-" if embedding else ""
tokenizer = LlamaTokenizer.from_pretrained(org_in+model_name)
model = LlamaForCausalLM.from_pretrained(org_in+model_name)
prompt = "Hello, this is a test."
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=50)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
model_llama = model
if embedding:
model_llama = model_llama.model
# 2. Push to a new Hugging Face repository
# Make sure you have run `huggingface-cli login` beforehand to authenticate
model_llama.push_to_hub(org_out+embedding_name+model_name, token="xxx")
tokenizer.push_to_hub(org_out+embedding_name+model_name, token="xx")
``` |