File size: 1,228 Bytes
57b4c88 cf290cb 57b4c88 |
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 |
---
license: mit
pipeline_tag: text-generation
---
# VLM 1 K2
- Second model of VLM series (**V**ortex **L**anguage **M**odel)
- K stands for **K**nowledge (Higher is better)
## Use the model:
- Open [Google Colab](https://colab.research.google.com/)
- Create new notebook
- Paste this code in the cell:
```python
!pip install transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "VortexIntelligence/VLM-1-K2"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
print("VLM Chat\nType 'exit' to quit")
while True:
user_input = input("You: ")
if user_input.strip().lower() == "exit":
break
input_ids = tokenizer(user_input, return_tensors="pt").input_ids
input_ids = input_ids[:, -1024:]
with torch.no_grad():
output = model.generate(
input_ids,
max_new_tokens=50,
do_sample=True,
temperature=0.7,
top_p=0.9,
pad_token_id=tokenizer.eos_token_id
)
new_tokens = output[0][input_ids.shape[1]:]
response = tokenizer.decode(new_tokens, skip_special_tokens=True)
print("VLM:", response.strip())
``` |