Views
No views yet
| Name | Quant method | Size |
|---|---|---|
| tinyllama-colorist-v2.q2_k.gguf | q2_k | 482.15 MB |
| tinyllama-colorist-v2.q3_k_m.gguf | q3_k_m | 549.85 MB |
| tinyllama-colorist-v2.q4_k_m.gguf | q4_k_m | 667.82 MB |
| tinyllama-colorist-v2.q5_k_m.gguf | q5_k_m | 782.05 MB |
| tinyllama-colorist-v2.q6_k.gguf | q6_k | 903.42 MB |
| tinyllama-colorist-v2.q8_0.gguf | q8_0 | 1.17 GB |
1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
3from transformers import pipeline
4
5def print_color_space(hex_color):
6 def hex_to_rgb(hex_color):
7 hex_color = hex_color.lstrip('#')
8 return tuple(int(hex_color[i:i+2], 16) for i in (0, 2, 4))
9 r, g, b = hex_to_rgb(hex_color)
10 print(f'{hex_color}: \033[48;2;{r};{g};{b}m \033[0m')
11
12tokenizer = AutoTokenizer.from_pretrained(model_id_colorist_final)
13pipe = pipeline(
14 "text-generation",
15 model=model_id_colorist_final,
16 torch_dtype=torch.float16,
17 device_map="auto",
18)
19
20from time import perf_counter
21start_time = perf_counter()
22
23prompt = formatted_prompt('give me a pure brown color')
24sequences = pipe(
25 prompt,
26 do_sample=True,
27 temperature=0.1,
28 top_p=0.9,
29 num_return_sequences=1,
30 eos_token_id=tokenizer.eos_token_id,
31 max_new_tokens=12
32)
33for seq in sequences:
34 print(f"Result: {seq['generated_text']}")
35
36output_time = perf_counter() - start_time
37print(f"Time taken for inference: {round(output_time,2)} seconds")
38Result: <|im_start|>user
give me a pure brown color<|im_end|>
<|im_start|>assistant: #807070<|im_end>
Time taken for inference: 0.19 seconds