Files changed (1) hide show
  1. README.md +86 -3
README.md CHANGED
@@ -1,3 +1,86 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ library_name: adapter-transformers
4
+ datasets:
5
+ - bigcode/self-oss-instruct-sc2-exec-filter-50k
6
+ language:
7
+ - en
8
+ metrics:
9
+ - accuracy
10
+ base_model:
11
+ - Qwen/Qwen2.5-Coder-1.5B
12
+ pipeline_tag: text-generation
13
+ tags:
14
+ - code
15
+ ---
16
+ """
17
+ Arachnom — Quick Start
18
+ ======================
19
+ Public model by David Woodayan
20
+ HuggingFace: https://huggingface.co/Woodayan/Arachnom
21
+
22
+ Install:
23
+ pip install transformers torch
24
+ """
25
+
26
+ from transformers import AutoModelForCausalLM, AutoTokenizer
27
+ import torch
28
+
29
+
30
+ print("Loading Arachnom...")
31
+
32
+ MODEL = "Woodayan/Arachnom"
33
+
34
+ tokenizer = AutoTokenizer.from_pretrained(MODEL, trust_remote_code=True)
35
+
36
+ model = AutoModelForCausalLM.from_pretrained(
37
+ MODEL,
38
+ torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
39
+ device_map="auto",
40
+ trust_remote_code=True,
41
+ )
42
+ model.eval()
43
+
44
+ device = next(model.parameters()).device
45
+ print(f"Ready on {device}\n")
46
+
47
+
48
+ SYSTEM = (
49
+ "You are Arachnom, a scientifically advanced AGI created by David Woodayan. "
50
+ "Respond in English only."
51
+ )
52
+
53
+ def ask(question: str, max_tokens: int = 512) -> str:
54
+ prompt = f"System: {SYSTEM}\nUser: {question}\nAssistant:"
55
+ inputs = tokenizer(prompt, return_tensors="pt").to(device)
56
+
57
+ with torch.inference_mode():
58
+ output = model.generate(
59
+ **inputs,
60
+ max_new_tokens = max_tokens,
61
+ do_sample = True,
62
+ temperature = 0.7,
63
+ top_p = 0.9,
64
+ repetition_penalty = 1.15,
65
+ pad_token_id = tokenizer.eos_token_id,
66
+ eos_token_id = tokenizer.eos_token_id,
67
+ )
68
+
69
+ return tokenizer.decode(
70
+ output[0][inputs["input_ids"].shape[1]:],
71
+ skip_special_tokens=True,
72
+ ).strip()
73
+
74
+ # ── Chat loop ─────────────────────────────────────────────────
75
+ print("=" * 45)
76
+ print(" Arachnom | type 'exit' to quit")
77
+ print("=" * 45)
78
+
79
+ while True:
80
+ user = input("\nYou: ").strip()
81
+ if not user:
82
+ continue
83
+ if user.lower() in ("exit", "quit", "q"):
84
+ print("Bye.")
85
+ break
86
+ print(f"\nArachnom: {ask(user)}")