Views
No views yet
1>>> text="9.11和9.8哪个数字大"
2>>> ./llama-cli -m DeepSeek-V3-bf16-256x20B-Q4_0.gguf-00001-of-00009.gguf -p "<|begin▁of▁sentence|>You are a helpful assistant.<|User|>$text\n<|Assistant|>" -n 512 --threads 16 -no-cnv
3## Generated:
4## 要比较 **9.11** 和 **9.8** 的大小,可以将它们转化为小数形式以便比较。
5## 1. **9.11** 已经是小数形式。
6## 2. **9.8** 可以表示为 **9.80**。
7## 现在比较小数点后的数字:
8## - **9.11** 的小数部分是 **0.11**
9## - **9.80** 的小数部分是 **0.80**
10## 因为 **0.80** > **0.11**,所以 **9.8** 大于 **9.11**。
11## 最终答案是:
12## \boxed{9.8} [end of text]
13
14
15>>> text="strawberry中有几个r?"
16>>> ./llama-cli -m DeepSeek-V3-bf16-256x20B-Q4_0.gguf-00001-of-00009.gguf -p "<|begin▁of▁sentence|>You are a helpful assistant.<|User|>$text\n<|Assistant|>" -n 512 --threads 16 -no-cnv
17## Generated:
18## The word "strawberry" contains two 'r' characters. Here's the breakdown:
19## - **S**
20## - **T**
21## - **R**
22## - **A**
23## - **W**
24## - **B**
25## - **E**
26## - **R**
27## - **R**
28## - **Y**
29## So, there are **2** 'r' in "strawberry". [end of text]
30
31
32>>> text="There is a girl who likes adventure,"
33>>> ./llama-cli -m DeepSeek-V3-bf16-256x20B-Q4_0.gguf-00001-of-00009.gguf -p "<|begin▁of▁sentence|>You are a helpful assistant.<|User|>$text\n<|Assistant|>" -n 512 --threads 16 -no-cnv
34## Generated:
35## That’s great! Adventures can be thrilling and enriching experiences. Here are a few ideas to inspire her adventurous spirit:
36## ### Outdoor Adventures:
37## 1. **Hiking**: Explore national parks or local trails to connect with nature.
38## 2. **Camping**: Spend a night under the stars or in a forest.
39## 3. **Rock Climbing**: Challenge yourself with cliffs or indoor climbing walls.
40## 4. **Kayaking or Canoeing**: Explore rivers, lakes, or even the ocean.
41## ### Travel Adventures:
42## 5. **Backpacking**: Travel to new countries or regions with minimal luggage.
43## 6. **Road Trips**: Explore nearby towns or cities by driving or biking.
44## 7. **Volunteering Abroad**: Combine adventure with helping others in foreign countries.
45##
46## ### Thrilling Activities:
47## 8. **Skydiving**: Experience the thrill of free-falling.
48## 9. **Scuba Diving**: Discover underwater worlds and marine life.
49## 10. **Zip-lining**: Feel the rush of flying through the air.
50##
51## ### Creative Adventures:
52## 11. **Urban Exploration**: Discover hidden gems in your city or town.
53## 12. **Photography Expeditions**: Capture unique landscapes or cultures.
54## 13. **Learning Something New**: Try a hobby like surfing, pottery, or archery.
55##
56## ### Nature Adventures:
57## 14. **Wildlife Safaris**: Observe animals in their natural habitats.
58## 15. **Forest Bathing**: Immerse yourself in nature for relaxation and mindfulness.
59## 16. **Gardening**: Explore growing your own plants or creating a garden.
60##
61## ### Cultural Adventures:
62## 17. **Festivals**: Attend cultural events to learn about traditions.
63## 18. **Historical Sites**: Visit museums, ruins, or ancient landmarks.
64## 19. **Language Learning**: Learn a new language and immerse yourself in its culture.
65##
66## No matter the adventure, it’s important to stay safe, prepared, and open-minded. Adventure is about exploring, learning, and embracing the unknown! 🌟 [end of text]
67
68
69>>> text="Please give a brief introduction of DeepSeek company."
70>>> ./llama-cli -m DeepSeek-V3-bf16-256x20B-Q4_0.gguf-00001-of-00009.gguf -p "<|begin▁of▁sentence|>You are a helpful assistant.<|User|>$text\n<|Assistant|>" -n 512 --threads 16 -no-cnv
71## Generated:
72## DeepSeek is a Chinese company specializing in artificial intelligence (AI) technologies and applications. Founded in 2023, DeepSeek focuses on developing advanced AI solutions for various industries, including finance, healthcare, education, and entertainment. The company emphasizes innovation in natural language processing (NLP), machine learning, and data analytics to create intelligent systems that enhance decision-making and efficiency. DeepSeek aims to bridge the gap between cutting-edge AI research and practical applications, contributing to technological advancements and digital transformation across sectors. [end of text]1import safetensors
2from safetensors.torch import save_file
3
4for i in range(1, 164):
5 idx_str = "0" * (5-len(str(i))) + str(i)
6 safetensors_path = f"model-{idx_str}-of-000163.safetensors"
7 print(safetensors_path)
8 tensors = dict()
9 with safetensors.safe_open(safetensors_path, framework="pt") as f:
10 for key in f.keys():
11 tensors[key] = f.get_tensor(key)
12 save_file(tensors, safetensors_path, metadata={'format': 'pt'})1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4model_name = DeepSeek-V3-hf
5tokenizer = AutoTokenizer.from_pretrained(model_name)
6model = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True, torch_dtype="auto")
7
8block = model.model.layers
9device_map = {}
10for n, m in block.named_modules():
11 if isinstance(m, (torch.nn.Linear, transformers.modeling_utils.Conv1D)):
12 if "experts" in n and ("shared_experts" not in n) and int(n.split('.')[-2])<63 and "down_proj" not in n :
13 device ="cuda:1"
14 elif "experts" in n and ("shared_experts" not in n) and "down_proj" in n and int(n.split('.')[-2])<63:
15 device = "cuda:1"
16 elif "experts" in n and ("shared_experts" not in n) and int(n.split('.')[-2]) >= 63 and int(n.split('.')[-2]) < 128 and "down_proj" not in n:
17 device = "cuda:2"
18 elif "experts" in n and ("shared_experts" not in n) and "down_proj" in n and int(n.split('.')[-2]) >= 63 and int(n.split('.')[-2]) < 128:
19 device = "cuda:2"
20 elif "experts" in n and ("shared_experts" not in n) and int(n.split('.')[-2]) >= 128 and int(
21 n.split('.')[-2]) < 192 and "down_proj" not in n:
22 device = "cuda:3"
23 elif "experts" in n and ("shared_experts" not in n) and "down_proj" in n and int(
24 n.split('.')[-2]) >= 128 and int(n.split('.')[-2]) < 192:
25 device = "cuda:3"
26 elif "experts" in n and ("shared_experts" not in n) and "down_proj" not in n and int(
27 n.split('.')[-2]) >= 192:
28 device = "cuda:4"
29 elif "experts" in n and ("shared_experts" not in n) and "down_proj" in n and int(
30 n.split('.')[-2]) >= 192:
31 device = "cuda:4"
32 else:
33 device = "cuda:0"
34 n = n[2:]
35 device_map.update({n: device})
36
37from auto_round import AutoRound
38
39autoround = AutoRound(model=model, tokenizer=tokenizer, device_map=device_map,
40 iters=200,batch_size=8, seqlen=512, enable_torch_compile=False)
41autoround.quantize()
42autoround.save_quantized(format="gguf:q4_0", output_dir="tmp_autoround")