Instructions to use sixf0ur/tiny-lm-chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use sixf0ur/tiny-lm-chat with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf sixf0ur/tiny-lm-chat:F16 # Run inference directly in the terminal: llama cli -hf sixf0ur/tiny-lm-chat:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf sixf0ur/tiny-lm-chat:F16 # Run inference directly in the terminal: llama cli -hf sixf0ur/tiny-lm-chat:F16
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf sixf0ur/tiny-lm-chat:F16 # Run inference directly in the terminal: ./build/bin/llama cli -hf sixf0ur/tiny-lm-chat:F16
Use Docker
docker model run hf.co/sixf0ur/tiny-lm-chat:F16
- Llama new
- LM Studio
- Jan
- Ollama
How to use sixf0ur/tiny-lm-chat with Ollama:
ollama run hf.co/sixf0ur/tiny-lm-chat:F16
- Unsloth Desktop
- Docker Model Runner
How to use sixf0ur/tiny-lm-chat with Docker Model Runner:
docker model run hf.co/sixf0ur/tiny-lm-chat:F16
- Lemonade
How to use sixf0ur/tiny-lm-chat with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull sixf0ur/tiny-lm-chat:F16
Run and chat with the model
lemonade run user.tiny-lm-chat-F16
List all available models
lemonade list
- Atomic Chat
Update README.md
Browse files
README.md
CHANGED
|
@@ -31,4 +31,77 @@ It was designed to do singleturn chats in very simple language (input / output).
|
|
| 31 |
🤖 **Bot:** Check your pockets or the door.
|
| 32 |
|
| 33 |
💬 **User:** Are you a human?
|
| 34 |
-
🤖 **Bot:** Nope, just a language.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
🤖 **Bot:** Check your pockets or the door.
|
| 32 |
|
| 33 |
💬 **User:** Are you a human?
|
| 34 |
+
🤖 **Bot:** Nope, just a language.
|
| 35 |
+
|
| 36 |
+
### Recommend generation config
|
| 37 |
+
```python
|
| 38 |
+
temperature=0.75,
|
| 39 |
+
top_p=0.9,
|
| 40 |
+
repetition_penalty=1.1,
|
| 41 |
+
do_sample=True,
|
| 42 |
+
pad_token_id=tokenizer.pad_token_id,
|
| 43 |
+
eos_token_id=tokenizer.eos_token_id,
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
## Usage for chat in terminal
|
| 47 |
+
```python
|
| 48 |
+
import torch
|
| 49 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 50 |
+
|
| 51 |
+
def main():
|
| 52 |
+
REPO_ID = "sixf0ur/tiny-lm-chat"
|
| 53 |
+
MAX_CONTEXT = 192
|
| 54 |
+
|
| 55 |
+
tokenizer = AutoTokenizer.from_pretrained(REPO_ID)
|
| 56 |
+
model = AutoModelForCausalLM.from_pretrained(REPO_ID, torch_dtype=torch.bfloat16)
|
| 57 |
+
model.eval()
|
| 58 |
+
|
| 59 |
+
# custom tokens used for interaction
|
| 60 |
+
BOS_ID = tokenizer.convert_tokens_to_ids("<bos>")
|
| 61 |
+
USER_ID = tokenizer.convert_tokens_to_ids("<user>")
|
| 62 |
+
BOT_ID = tokenizer.convert_tokens_to_ids("<bot>")
|
| 63 |
+
|
| 64 |
+
print("="*50 + "\n")
|
| 65 |
+
|
| 66 |
+
while True:
|
| 67 |
+
user_input = input("User: ").strip()
|
| 68 |
+
|
| 69 |
+
if user_input.lower() in ["exit", "quit", "q"]:
|
| 70 |
+
break
|
| 71 |
+
if not user_input:
|
| 72 |
+
continue
|
| 73 |
+
|
| 74 |
+
user_token_ids = tokenizer.encode(user_input, add_special_tokens=False)
|
| 75 |
+
|
| 76 |
+
prompt_ids = [BOS_ID, USER_ID] + user_token_ids + [BOT_ID]
|
| 77 |
+
prompt_len = len(prompt_ids)
|
| 78 |
+
|
| 79 |
+
max_new_tokens = MAX_CONTEXT - prompt_len
|
| 80 |
+
|
| 81 |
+
if max_new_tokens <= 5:
|
| 82 |
+
print(f"(Input too long!\n")
|
| 83 |
+
continue
|
| 84 |
+
|
| 85 |
+
input_ids = torch.tensor([prompt_ids])
|
| 86 |
+
|
| 87 |
+
with torch.no_grad():
|
| 88 |
+
outputs = model.generate(
|
| 89 |
+
input_ids,
|
| 90 |
+
max_new_tokens=max_new_tokens,
|
| 91 |
+
temperature=0.75,
|
| 92 |
+
top_p=0.9,
|
| 93 |
+
repetition_penalty=1.1,
|
| 94 |
+
do_sample=True,
|
| 95 |
+
pad_token_id=tokenizer.pad_token_id,
|
| 96 |
+
eos_token_id=tokenizer.eos_token_id,
|
| 97 |
+
)
|
| 98 |
+
|
| 99 |
+
generated_ids = outputs[0][prompt_len:]
|
| 100 |
+
response = tokenizer.decode(generated_ids, skip_special_tokens=True)
|
| 101 |
+
|
| 102 |
+
print(f"\nBot: {response.strip()}")
|
| 103 |
+
print("\n" + "="*50)
|
| 104 |
+
|
| 105 |
+
if __name__ == "__main__":
|
| 106 |
+
main()
|
| 107 |
+
```
|