abrakjamson commited on
Commit
2b78064
1 Parent(s): 0caf2c2

Partially functional on Llama

Browse files
all_truncated_outputs.json ADDED
@@ -0,0 +1,584 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ "",
3
+ "That game",
4
+ "I can see",
5
+ "Hmm, this",
6
+ "I can relate to",
7
+ "Who is",
8
+ "I understand the",
9
+ "Ugh,",
10
+ "What the hell was",
11
+ "Hey, did anyone",
12
+ "Although",
13
+ "Thank you for choosing",
14
+ "What are you",
15
+ "Oh w",
16
+ "How dare you open",
17
+ "It was my pleasure",
18
+ "I'm hon",
19
+ "I appreciate that you",
20
+ "Are you k",
21
+ "Whoever left this",
22
+ "It's always",
23
+ "Ew,",
24
+ "Hey, I l",
25
+ "Hello? Is someone",
26
+ "I understand that",
27
+ "That poem",
28
+ "Aww, poor",
29
+ "Hey, it",
30
+ "Alright, who",
31
+ "I didn't",
32
+ "Well, life",
33
+ "The document",
34
+ "Oh no, this",
35
+ "I'm concerned",
36
+ "Hello, this is",
37
+ "This art",
38
+ "Hmm, this drink",
39
+ "Hi there!",
40
+ "It seems",
41
+ "Is",
42
+ "Good",
43
+ "I can't",
44
+ "Ex",
45
+ "Who are",
46
+ "I can see that",
47
+ "Wow,",
48
+ "Today is a",
49
+ "Hey friend",
50
+ "Sometimes friends",
51
+ "Oh, this old",
52
+ "The weather outside",
53
+ "This place is sur",
54
+ "I appreciate your input",
55
+ "Thank you for the",
56
+ "Look at",
57
+ "I'm disappoint",
58
+ "To my",
59
+ "How dare you",
60
+ "That's an",
61
+ "This piece of art",
62
+ "Eww",
63
+ "This park is",
64
+ "This is incredible",
65
+ "Oh no, someone",
66
+ "Exc",
67
+ "Well, it'",
68
+ "I warned",
69
+ "Hey, I understand",
70
+ "Hey, I saw",
71
+ "How dare you go",
72
+ "What the he",
73
+ "Hey",
74
+ "It's",
75
+ "Hello? Hello?",
76
+ "It",
77
+ "Oh no!",
78
+ "This is the perfect",
79
+ "Good morning,",
80
+ "Oh no, there",
81
+ "It's so",
82
+ "Yeah",
83
+ "Uh,",
84
+ "Hello everyone",
85
+ "Who turned off",
86
+ "The weather",
87
+ "Who'",
88
+ "Hey, this",
89
+ "Wait,",
90
+ "Eww, gross",
91
+ "Excuse",
92
+ "It seems like you",
93
+ "Thank you so",
94
+ "What happened?",
95
+ "Oh my g",
96
+ "I am deeply sad",
97
+ "I war",
98
+ "Okay, let'",
99
+ "Hey, that",
100
+ "That was a beautiful",
101
+ "Oh no! That",
102
+ "What happened",
103
+ "Hey there",
104
+ "The artist'",
105
+ "What?!",
106
+ "Hey, it'",
107
+ "I am disappoint",
108
+ "It seems like",
109
+ "Oh no! The",
110
+ "This park is a",
111
+ "If you",
112
+ "Yes! I did",
113
+ "It sounds",
114
+ "What",
115
+ "Who is it",
116
+ "Hmm, that",
117
+ "That's strange",
118
+ "Yeah, that was",
119
+ "That's interesting",
120
+ "This park",
121
+ "What the hell",
122
+ "Who is that",
123
+ "I feel like my",
124
+ "Oh well",
125
+ "What the hell is",
126
+ "Hello? Hello",
127
+ "To my dearest",
128
+ "Bless you!\"",
129
+ "Thank you for",
130
+ "Oh, looks like",
131
+ "Can you please",
132
+ "This place is",
133
+ "Eww, what",
134
+ "Bless you",
135
+ "Is everything",
136
+ "Hey, I just",
137
+ "Whoever left these",
138
+ "Well, that'",
139
+ "I feel",
140
+ "Hey, do you",
141
+ "It's sad",
142
+ "Oh no, it",
143
+ "Hey, that'",
144
+ "Oh my god,",
145
+ "Thank you,",
146
+ "Hello little one,",
147
+ "I apolog",
148
+ "Hey team, I",
149
+ "How dare you read",
150
+ "Who is this and",
151
+ "Whoever left",
152
+ "Hi there! W",
153
+ "A",
154
+ "If you have",
155
+ "I was",
156
+ "U",
157
+ "Bless",
158
+ "Well, this",
159
+ "Oh, I'",
160
+ "It's a",
161
+ "Eww,",
162
+ "Is everything okay?",
163
+ "Oh, I",
164
+ "Hello, can you",
165
+ "Al",
166
+ "That was a great",
167
+ "What are",
168
+ "I understand that not",
169
+ "Oh no, not",
170
+ "Who is it?\"",
171
+ "Hey, can we",
172
+ "Whoever is taking",
173
+ "I would love to",
174
+ "Hey, I noticed",
175
+ "Hey, could",
176
+ "I understand that there",
177
+ "Hello?",
178
+ "D",
179
+ "Oh man, I",
180
+ "Thank you so much",
181
+ "Oh no, my",
182
+ "Dear [Name",
183
+ "Uh",
184
+ "I remember",
185
+ "Hey, who",
186
+ "Well, it",
187
+ "Are you",
188
+ "I understand that it",
189
+ "Hey, is",
190
+ "I would",
191
+ "Who is this",
192
+ "Excuse me",
193
+ "Alright",
194
+ "I am thrilled",
195
+ "Sometimes friends have",
196
+ "Who the",
197
+ "It's interesting",
198
+ "I would love",
199
+ "E",
200
+ "Hello? Is anyone",
201
+ "Well, this is",
202
+ "This place",
203
+ "Well,",
204
+ "I warned you",
205
+ "Hey, watch where",
206
+ "Oh my",
207
+ "That'",
208
+ "Sometimes friends have different",
209
+ "I understand that everyone",
210
+ "What?",
211
+ "What do these notes",
212
+ "I can relate",
213
+ "I'm not",
214
+ "I understand",
215
+ "To my dear",
216
+ "Guys",
217
+ "Well",
218
+ "Hey, I appreciate",
219
+ "Wow, what",
220
+ "Dear",
221
+ "That melody",
222
+ "Who the hell",
223
+ "Today is",
224
+ "Hello little",
225
+ "Wow, look",
226
+ "That's great",
227
+ "Love is never wrong",
228
+ "I'm having",
229
+ "Whoa, did",
230
+ "Ugh",
231
+ "Can you please provide",
232
+ "I miss you,",
233
+ "I feel uncom",
234
+ "I know",
235
+ "Ugh, this",
236
+ "Hey, watch",
237
+ "Oh great, a",
238
+ "I didn",
239
+ "Okay",
240
+ "That game of char",
241
+ "Oh",
242
+ "I appreciate",
243
+ "Who's there",
244
+ "I am so",
245
+ "Oh great, someone",
246
+ "Hey, could you",
247
+ "I remember wondering",
248
+ "Wait, what?",
249
+ "What do",
250
+ "Hello? Can",
251
+ "Hey there,",
252
+ "That game of",
253
+ "This is incred",
254
+ "Oh my gosh",
255
+ "Oh great, f",
256
+ "I appreciate your",
257
+ "It sounds like",
258
+ "What the heck",
259
+ "Okay, I understand",
260
+ "Ew",
261
+ "I understand that this",
262
+ "Uh, hi",
263
+ "Hi everyone!",
264
+ "What the hell?",
265
+ "Thank you for your",
266
+ "Oh no, the",
267
+ "Wow, I",
268
+ "Who turned",
269
+ "Dear [",
270
+ "Whoever",
271
+ "This is a",
272
+ "Whoa, he",
273
+ "What in the world",
274
+ "Although the physical",
275
+ "Hello, who is",
276
+ "That's amaz",
277
+ "Hey, I know",
278
+ "Okay, that",
279
+ "Hi everyone",
280
+ "Hey, is everything",
281
+ "I understand your fr",
282
+ "Oh no, poor",
283
+ "Oh, look",
284
+ "Good morning",
285
+ "Ew, gross",
286
+ "Oh no, did",
287
+ "Look at the family",
288
+ "Hey team",
289
+ "Yes!",
290
+ "Hey, can I",
291
+ "Okay, that'",
292
+ "It's great",
293
+ "Love is",
294
+ "Hey, what",
295
+ "Good morning, world",
296
+ "Who is it?",
297
+ "That poem really reson",
298
+ "I",
299
+ "That's",
300
+ "I understand the task",
301
+ "Gu",
302
+ "Hello? Who'",
303
+ "This postcard is",
304
+ "Whoa,",
305
+ "Oh, that",
306
+ "I understand that I",
307
+ "Whoever is",
308
+ "Hello? Who is",
309
+ "I'm really",
310
+ "Wow, this",
311
+ "Can",
312
+ "This artwork really",
313
+ "This is a shame",
314
+ "I miss you too",
315
+ "Who are you?",
316
+ "Today is a difficult",
317
+ "Hey, just",
318
+ "Are you okay",
319
+ "I am",
320
+ "Hi,",
321
+ "Wow, that",
322
+ "Hey there! Can",
323
+ "Okay, stay",
324
+ "Oh great, just",
325
+ "Yeah,",
326
+ "Hello? Can you",
327
+ "Oh, looks",
328
+ "Thank you for sharing",
329
+ "I'm glad",
330
+ "Hey, is that",
331
+ "Hmm",
332
+ "It was my",
333
+ "It sounds like you",
334
+ "Wow, your",
335
+ "I was promised certain",
336
+ "That was such a",
337
+ "Thank",
338
+ "Excuse you",
339
+ "That was",
340
+ "Hey team,",
341
+ "I feel un",
342
+ "It was",
343
+ "What'",
344
+ "Hey friend, I",
345
+ "How",
346
+ "Saying goodbye",
347
+ "That",
348
+ "It's heart",
349
+ "How dare",
350
+ "Oh,",
351
+ "Hello, may",
352
+ "What's this",
353
+ "Thank you for recogn",
354
+ "Aww, that",
355
+ "Oh, I remember",
356
+ "Hmm, that'",
357
+ "I miss",
358
+ "I know this",
359
+ "Wait",
360
+ "Is everything okay",
361
+ "Who is that person",
362
+ "Wow, you",
363
+ "Oh great",
364
+ "I'm sad",
365
+ "Wow, the",
366
+ "I am very disappoint",
367
+ "Who turned off the",
368
+ "I understand that things",
369
+ "I'm very",
370
+ "Hi",
371
+ "That's very",
372
+ "Okay, I",
373
+ "Oh no,",
374
+ "Wow, there",
375
+ "What's wrong",
376
+ "I apologize for",
377
+ "Hey, I",
378
+ "Can I help you",
379
+ "Oh, I didn",
380
+ "Alright,",
381
+ "Oh wow,",
382
+ "Oh my goodness",
383
+ "I know this event",
384
+ "What in the",
385
+ "Saying",
386
+ "Yeah, that",
387
+ "Guys, I",
388
+ "Hey, this v",
389
+ "This post",
390
+ "Are",
391
+ "Hey, can",
392
+ "Hello? Is",
393
+ "I can only imagine",
394
+ "Oh, that sounds",
395
+ "Hey, is anyone",
396
+ "I am disappointed",
397
+ "Hello,",
398
+ "Hey everyone, I",
399
+ "That was such",
400
+ "It's okay",
401
+ "The artist",
402
+ "Whoa",
403
+ "I understand that mistakes",
404
+ "Can I help",
405
+ "Who",
406
+ "Hi everyone! I",
407
+ "Hey, can you",
408
+ "Wow, how",
409
+ "Today",
410
+ "Oh no, I",
411
+ "Oh well, I",
412
+ "Well, that",
413
+ "This is the",
414
+ "Yes! I finally",
415
+ "Hey there little",
416
+ "Hello everyone!",
417
+ "Love is never",
418
+ "Look at the",
419
+ "This postcard",
420
+ "Oh great,",
421
+ "Can I",
422
+ "Hmm, this is",
423
+ "I understand your",
424
+ "Oh, look at",
425
+ "B",
426
+ "I'm so",
427
+ "Whoa, this",
428
+ "W",
429
+ "Oh, this",
430
+ "Sometimes",
431
+ "This piece of",
432
+ "What the",
433
+ "That was a",
434
+ "Hey, do",
435
+ "Oh no",
436
+ "Whoa, what",
437
+ "I feel like I",
438
+ "The documentary",
439
+ "Hello",
440
+ "Hello little one",
441
+ "I understand that my",
442
+ "Eww, that",
443
+ "Wow, an",
444
+ "Yes! Finally,",
445
+ "Although the physical location",
446
+ "Whoever is watching",
447
+ "That movie",
448
+ "I remember wondering about",
449
+ "Hey there, little",
450
+ "Who's",
451
+ "Hello, who",
452
+ "Hello everyone! Thank",
453
+ "Hello, can",
454
+ "That's too",
455
+ "Hey, just wanted",
456
+ "Hey there, I",
457
+ "Saying good",
458
+ "Hey there!",
459
+ "Who is there?",
460
+ "Oh my good",
461
+ "I am very",
462
+ "Oh no, what",
463
+ "Wow, thank",
464
+ "I was promised",
465
+ "Hi, is",
466
+ "Hey, I'",
467
+ "Guys, the",
468
+ "Oh no, that",
469
+ "Who is there",
470
+ "Hello, this",
471
+ "That movie really touched",
472
+ "If you have something",
473
+ "The documentary was",
474
+ "I'm starting",
475
+ "Are you kidd",
476
+ "That movie really",
477
+ "Hey everyone,",
478
+ "Thank you for considering",
479
+ "I didn'",
480
+ "Yes! I",
481
+ "Can you",
482
+ "Oh my god",
483
+ "Hey, whoever",
484
+ "That melody really",
485
+ "Thank you, little",
486
+ "Hello, may I",
487
+ "Look",
488
+ "Wow, we",
489
+ "It looks",
490
+ "What do these",
491
+ "Oh wow",
492
+ "I apologize",
493
+ "What are you all",
494
+ "It's such",
495
+ "It's clear",
496
+ "Hey, I was",
497
+ "Hey friend,",
498
+ "I can only",
499
+ "The weather outside is",
500
+ "Eww, this",
501
+ "I miss you",
502
+ "Wow",
503
+ "Aww,",
504
+ "Hi, is there",
505
+ "This artwork",
506
+ "Okay,",
507
+ "Oh well,",
508
+ "This",
509
+ "I'",
510
+ "Say",
511
+ "Hey there little gu",
512
+ "Hmm,",
513
+ "Whoa, who",
514
+ "I am thr",
515
+ "Oh man",
516
+ "Okay, stay calm",
517
+ "I'm happy",
518
+ "Oh, this cur",
519
+ "Oh man,",
520
+ "I'm sorry",
521
+ "Hello? Who",
522
+ "What?! That",
523
+ "This piece",
524
+ "Hey everyone",
525
+ "That's so",
526
+ "Are you okay?",
527
+ "What happened? Where",
528
+ "Hi there",
529
+ "The",
530
+ "Who the hell entered",
531
+ "I can",
532
+ "Guys,",
533
+ "What's",
534
+ "What in",
535
+ "It's important",
536
+ "I'm",
537
+ "I'm coming",
538
+ "It'",
539
+ "Yes! Finally",
540
+ "Wait, what",
541
+ "Wow, reading",
542
+ "I'm surprised",
543
+ "Hey, did",
544
+ "Hey,",
545
+ "Okay, let",
546
+ "I understand that you",
547
+ "Who the hell threw",
548
+ "Eww, who",
549
+ "Thank you for thinking",
550
+ "Who is this?\"",
551
+ "I am deeply",
552
+ "Thank you for including",
553
+ "Oh no, an",
554
+ "It looks like you",
555
+ "Aww",
556
+ "I'm confused",
557
+ "Wow, it",
558
+ "That poem really",
559
+ "Yes",
560
+ "Hey there, is",
561
+ "Hey, what'",
562
+ "Thank you for remember",
563
+ "To",
564
+ "This is",
565
+ "Thank you for making",
566
+ "I can'",
567
+ "That mel",
568
+ "Wow, they",
569
+ "I feel like",
570
+ "Although the",
571
+ "Who are you",
572
+ "Love",
573
+ "If",
574
+ "What the hell are",
575
+ "I am so sad",
576
+ "Oh, I found",
577
+ "Thank you",
578
+ "It looks like",
579
+ "Well, life is",
580
+ "I appreciate that",
581
+ "The artist's",
582
+ "Whoa, that",
583
+ "It's never"
584
+ ]
app.py CHANGED
@@ -13,16 +13,17 @@ import gradio as gr
13
  from huggingface_hub import login
14
 
15
  # Initialize model and tokenizer
16
- mistral_path = "mistralai/Mistral-7B-Instruct-v0.3"
 
17
 
18
- access_token = os.getenv("mistralaccesstoken")
19
  login(access_token)
20
 
21
- tokenizer = AutoTokenizer.from_pretrained(mistral_path)
22
  tokenizer.pad_token_id = 0
23
 
24
  model = AutoModelForCausalLM.from_pretrained(
25
- mistral_path,
26
  torch_dtype=torch.float16,
27
  trust_remote_code=True,
28
  use_safetensors=True
@@ -33,7 +34,10 @@ model = model.to("cuda:0" if cuda else "cpu")
33
  if cuda:
34
  print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
35
 
36
- model = ControlModel(model, list(range(-5, -18, -1)))
 
 
 
37
 
38
  # Generation settings
39
  # Generation settings
@@ -44,24 +48,25 @@ default_generation_settings = {
44
  "repetition_penalty": 1.1, # Reduce repetition
45
  }
46
 
47
- # Tags for prompt formatting
48
- user_tag, asst_tag = "[INST]", "[/INST]"
49
 
50
  # List available control vectors
51
  control_vector_files = [f for f in os.listdir('control_models') if f.endswith('.gguf')]
52
 
53
  if not control_vector_files:
54
- raise FileNotFoundError("No .gguf control vector files found in the control_models directory.")
 
55
 
56
  # Function to toggle slider visibility based on checkbox state
57
  def toggle_slider(checked):
58
  return gr.update(visible=checked)
59
 
60
- def construct_prompt(history, system_prompt, user_message):
61
  """
62
  Converts the history (list of tuples) back into the string format Mistral expects
63
  """
64
  formatted_prompt = ""
 
65
 
66
  # <s>[INST] user message[/INST] assistant message</s>[INST] new user message[/INST]
67
  # Mistral expects the history to be wrapped in <s>history</s>, so it's added here
@@ -86,6 +91,54 @@ def construct_prompt(history, system_prompt, user_message):
86
  formatted_prompt += f"{user_tag} {user_message} {asst_tag}"
87
  return formatted_prompt
88
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  def generate_response(system_prompt, user_message, history, max_new_tokens, repitition_penalty, do_sample, user_model, input_checkbox, input_slider, *args):
90
  """
91
  Applies the control vectors and calls the language model.
@@ -140,7 +193,7 @@ def generate_response(system_prompt, user_message, history, max_new_tokens, repi
140
  except Exception as e:
141
  print(f"Failed to set Control: {e}")
142
 
143
- formatted_prompt = construct_prompt(history, system_prompt, user_message)
144
 
145
  # Tokenize the input
146
  input_ids = tokenizer(formatted_prompt, return_tensors="pt").to(model.device)
@@ -186,9 +239,9 @@ def generate_response(system_prompt, user_message, history, max_new_tokens, repi
186
  # remove the trailing </s> if present
187
  # it won't be present if the model ran out from max_tokens
188
  def get_assistant_response(input_string):
189
- if len(input_string) >= 4:
190
- if input_string[-4:] == "</s>":
191
- return input_string[:-4]
192
  else:
193
  return input_string
194
  else:
@@ -361,6 +414,9 @@ def make_dataset(
361
  suffix_list: list[str]
362
  ) -> list[DatasetEntry]:
363
  dataset = []
 
 
 
364
  for suffix in suffix_list:
365
  for positive_persona, negative_persona in zip(positive_personas, negative_personas):
366
  positive_template = template.format(persona=positive_persona)
@@ -386,7 +442,7 @@ def train_model_persona(positive_text, negative_text):
386
  model.reset()
387
  output_model = ControlVector.train(model, tokenizer, dataset)
388
  # Write file to temporary directory returning the path to Gradio for download
389
- filename = re.sub(r'[ <>:"/\\|?*]', '', positive_text) + '_'
390
  temp_file = tempfile.NamedTemporaryFile(
391
  prefix=filename,
392
  suffix=".gguf",
@@ -405,7 +461,7 @@ def train_model_facts(positive_text, negative_text):
405
  "Pretend to be a {persona} making statements about the world.",
406
  positive_text,
407
  negative_text,
408
- fact_suffixes
409
  )
410
 
411
  output_model = ControlVector.train(model, tokenizer, dataset)
 
13
  from huggingface_hub import login
14
 
15
  # Initialize model and tokenizer
16
+ llama_path = "meta-llama/Llama-3.2-1B-Instruct"
17
+ #llama_path = r"E:/language_models/models/mistral"
18
 
19
+ access_token = os.getenv("llamaaccesstoken")
20
  login(access_token)
21
 
22
+ tokenizer = AutoTokenizer.from_pretrained(llama_path)
23
  tokenizer.pad_token_id = 0
24
 
25
  model = AutoModelForCausalLM.from_pretrained(
26
+ llama_path,
27
  torch_dtype=torch.float16,
28
  trust_remote_code=True,
29
  use_safetensors=True
 
34
  if cuda:
35
  print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
36
 
37
+ # in mistral, there are 32 layers from -31 to 0. set to 13 layers from -5 to -18
38
+ # model = ControlModel(model, list(range(-5, -18, -1)))
39
+ # in llama 3.2 there are 32 layers from -16 to 15. set to 13 layers from 11 to -2
40
+ model = ControlModel(model, list(range(14, 1, -1)))
41
 
42
  # Generation settings
43
  # Generation settings
 
48
  "repetition_penalty": 1.1, # Reduce repetition
49
  }
50
 
51
+
 
52
 
53
  # List available control vectors
54
  control_vector_files = [f for f in os.listdir('control_models') if f.endswith('.gguf')]
55
 
56
  if not control_vector_files:
57
+ pass
58
+ #raise FileNotFoundError("No .gguf control vector files found in the control_models directory.")
59
 
60
  # Function to toggle slider visibility based on checkbox state
61
  def toggle_slider(checked):
62
  return gr.update(visible=checked)
63
 
64
+ def construct_prompt_mistral(history, system_prompt, user_message):
65
  """
66
  Converts the history (list of tuples) back into the string format Mistral expects
67
  """
68
  formatted_prompt = ""
69
+ user_tag, asst_tag = "[INST]", "[/INST]"
70
 
71
  # <s>[INST] user message[/INST] assistant message</s>[INST] new user message[/INST]
72
  # Mistral expects the history to be wrapped in <s>history</s>, so it's added here
 
91
  formatted_prompt += f"{user_tag} {user_message} {asst_tag}"
92
  return formatted_prompt
93
 
94
+ def construct_prompt_llama(history, system_prompt, user_message):
95
+ """
96
+ Converts the history (list of tuples) back into the string format LLama expects
97
+ LLama prompt format:
98
+ <|begin_of_text|><|start_header_id|>system<|end_header_id|>
99
+ Cutting Knowledge Date: December 2023
100
+ Today Date: 23 July 2024
101
+ You are a helpful assistant
102
+ <|eot_id|>
103
+ <|start_header_id|>user<|end_header_id|>
104
+ What is the capital of France?
105
+ <|eot_id|>
106
+ <|start_header_id|>assistant<|end_header_id|>
107
+ """
108
+ formatted_prompt = ""
109
+
110
+ # Begin the prompt with the start token
111
+ formatted_prompt += "<|begin_of_text|>\n"
112
+
113
+ # Append the system prompt if provided
114
+ if system_prompt.strip():
115
+ formatted_prompt += "<|start_header_id|>system<|end_header_id|>\n"
116
+ formatted_prompt += f"{system_prompt.strip()}"
117
+ formatted_prompt += "<|eot_id|>\n"
118
+
119
+ # Construct the formatted prompt based on history
120
+ for user_msg, asst_msg in history:
121
+ # Append the user message
122
+ formatted_prompt += "<|start_header_id|>user<|end_header_id|>\n"
123
+ formatted_prompt += f"{user_msg.strip()}"
124
+ formatted_prompt += "<|eot_id|>\n"
125
+
126
+ # Append the assistant's response
127
+ formatted_prompt += "<|start_header_id|>assistant<|end_header_id|>\n"
128
+ formatted_prompt += f"{asst_msg.strip()}"
129
+ formatted_prompt += "<|eot_id|>\n"
130
+
131
+ # Append the new user message
132
+ formatted_prompt += "<|start_header_id|>user<|end_header_id|>\n"
133
+ formatted_prompt += f"{user_message.strip()}"
134
+ formatted_prompt += "<|eot_id|>\n"
135
+
136
+ # Indicate that the assistant should provide a response
137
+ formatted_prompt += "<|start_header_id|>assistant<|end_header_id|>\n"
138
+
139
+ return formatted_prompt
140
+
141
+
142
  def generate_response(system_prompt, user_message, history, max_new_tokens, repitition_penalty, do_sample, user_model, input_checkbox, input_slider, *args):
143
  """
144
  Applies the control vectors and calls the language model.
 
193
  except Exception as e:
194
  print(f"Failed to set Control: {e}")
195
 
196
+ formatted_prompt = construct_prompt_llama(history, system_prompt, user_message)
197
 
198
  # Tokenize the input
199
  input_ids = tokenizer(formatted_prompt, return_tensors="pt").to(model.device)
 
239
  # remove the trailing </s> if present
240
  # it won't be present if the model ran out from max_tokens
241
  def get_assistant_response(input_string):
242
+ if len(input_string) >= 10:
243
+ if input_string[-10:] == "<|eot_id|>":
244
+ return input_string[:-10]
245
  else:
246
  return input_string
247
  else:
 
414
  suffix_list: list[str]
415
  ) -> list[DatasetEntry]:
416
  dataset = []
417
+ # Tags for prompt formatting with Llama
418
+ user_tag = "<|start_header_id|>user<|end_header_id|>\n\n"
419
+ asst_tag = "<|eot_id|>\n<|start_header_id|>assistant<|end_header_id|>"
420
  for suffix in suffix_list:
421
  for positive_persona, negative_persona in zip(positive_personas, negative_personas):
422
  positive_template = template.format(persona=positive_persona)
 
442
  model.reset()
443
  output_model = ControlVector.train(model, tokenizer, dataset)
444
  # Write file to temporary directory returning the path to Gradio for download
445
+ filename = re.sub(r'[ <>:"/\\|?*]', '', positive_list[0]) + '_'
446
  temp_file = tempfile.NamedTemporaryFile(
447
  prefix=filename,
448
  suffix=".gguf",
 
461
  "Pretend to be a {persona} making statements about the world.",
462
  positive_text,
463
  negative_text,
464
+ fact_suffixes[0:150]
465
  )
466
 
467
  output_model = ControlVector.train(model, tokenizer, dataset)
control_models/Angry.gguf DELETED
Binary file (509 kB)
 
control_models/Confident.gguf DELETED
Binary file (509 kB)
 
control_models/Conspiracies.gguf DELETED
Binary file (509 kB)
 
control_models/Creative.gguf DELETED
Binary file (509 kB)
 
control_models/Empathatic.gguf DELETED
Binary file (509 kB)
 
control_models/Joking.gguf DELETED
Binary file (509 kB)
 
control_models/Lazy.gguf DELETED
Binary file (509 kB)
 
control_models/Optimistic.gguf DELETED
Binary file (509 kB)
 
control_models/Right-leaning.gguf DELETED
Binary file (509 kB)
 
control_models/Tripping.gguf DELETED
Binary file (509 kB)
 
control_models/truthful.gguf DELETED
Binary file (509 kB)
 
true_facts.csv ADDED
@@ -0,0 +1,306 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The Earth's atmosphere protects us from harmful radiation from the sun.
2
+ The theory of evolution, proposed by Charles Darwin, states that species evolve over time through natural selection.
3
+ The smallest planet in our solar system is Mercury.
4
+ The moon orbits around the Earth.
5
+ Fire needs oxygen to burn.
6
+ The Statue of Liberty was a gift from France to the United States.
7
+ Comets are icy celestial objects that orbit the Sun.
8
+ Light can exhibit both wave-like and particle-like properties.
9
+ Symbiosis is a close relationship between two species.
10
+ Pizza is a type of food that many people enjoy.
11
+ Sharks are sea creatures that have a reputation for being dangerous.
12
+ The scientific method is a systematic process for investigating phenomena and acquiring new knowledge.
13
+ Plate tectonics shape the Earth's surface.
14
+ The human heart beats approximately 100,000 times per day.
15
+ The color of the sky is blue.
16
+ Cacti store water in their stems.
17
+ The Panama Canal connects the Atlantic and Pacific oceans.
18
+ The three main types of symbiotic relationships are mutualism, commensalism, and parasitism.
19
+ Uranus orbits the Sun on its side.
20
+ The largest continent in the world is Asia.
21
+ The first successful powered flight was made by the Wright Brothers in 1903.
22
+ Jupiter has the Great Red Spot, a giant storm.
23
+ The human eye can detect millions of different colors.
24
+ The three states of matter are solid, liquid, and gas.
25
+ The water cycle includes evaporation, condensation, precipitation, and runoff.
26
+ The planet Uranus is often referred to as the "ice giant."
27
+ The sky is blue.
28
+ The average body temperature of a human is 98.6 degrees Fahrenheit.
29
+ The Earth is round.
30
+ DNA carries genetic information in living organisms.
31
+ The endocrine system regulates body functions through hormones.
32
+ The human body is composed of about 60% water.
33
+ The Great Wall of China is the longest wall in the world.
34
+ The planet Jupiter is the largest planet in our solar system.
35
+ Echoes are sound waves reflecting off surfaces.
36
+ The planet Venus is often referred to as the "morning star" or the "evening star."
37
+ Chemical reactions involve the rearrangement of atoms to form new substances.
38
+ The human brain weighs around 3 pounds.
39
+ The most abundant gas in Earth's atmosphere is nitrogen.
40
+ The highest mountain in North America is Denali.
41
+ The longest river in Europe is the Volga River.
42
+ Osmosis is the movement of water across a selectively permeable membrane.
43
+ The process by which a solid turns directly into a gas, without becoming a liquid, is called sublimation.
44
+ The Earth's tides are primarily caused by the gravitational pull of the moon.
45
+ Mercury is the smallest planet.
46
+ Cows are mammals that produce milk.
47
+ Plants need carbon dioxide to survive.
48
+ The Amazon River is the largest river in the world by volume.
49
+ The immune system defends the body against pathogens.
50
+ There are 118 elements on the periodic table.
51
+ New York City is the largest city in the United States.
52
+ The human brain controls the body's functions.
53
+ Cells are the basic units of life.
54
+ The largest desert in the world is the Sahara Desert.
55
+ Octopuses have three hearts.
56
+ The coldest natural temperature ever recorded was -128.6 degrees Fahrenheit in Antarctica.
57
+ The periodic table organizes elements based on their properties.
58
+ The electron configuration of an atom determines its chemical properties.
59
+ The largest bird in the world is the ostrich.
60
+ Sound travels as a wave through various mediums.
61
+ The three types of blood vessels in the human body are arteries, veins, and capillaries.
62
+ The planet Neptune is named after the Roman god of the sea.
63
+ The highest waterfall in the world is Angel Falls in Venezuela.
64
+ Human digestion begins in the mouth and ends in the small intestine.
65
+ Fish breathe through gills.
66
+ Water freezes at 0 degrees Celsius (32 degrees Fahrenheit).
67
+ The Eiffel Tower is located in Paris, France.
68
+ The Doppler effect causes the change in frequency or wavelength of a wave in relation to an observer.
69
+ Auroras occur near Earth's polar regions.
70
+ The study of heredity and the variation of inherited characteristics is called genetics.
71
+ Polar bears have white fur to camouflage in their snowy environment.
72
+ The planet Saturn has the largest rings in our solar system.
73
+ The human lymphatic system helps fight infections and diseases.
74
+ The Statue of Liberty is located in New York City.
75
+ The process of pollination is crucial for plant reproduction.
76
+ Neptune has the strongest winds in the solar system.
77
+ The Great Barrier Reef is the largest coral reef system in the world.
78
+ Snow is cold.
79
+ Mars has a thin atmosphere.
80
+ Earth has a magnetic field.
81
+ The study of substances and their interactions is called chemistry.
82
+ The Great Barrier Reef is the largest coral reef system in the world.
83
+ A human pregnancy typically lasts around 9 months.
84
+ Coral reefs are made of living organisms.
85
+ The continent of Antarctica is mostly covered in ice.
86
+ An adult human has 32 teeth.
87
+ The tallest mammal in the world is the giraffe.
88
+ Humans have five senses: sight, hearing, touch, taste, and smell.
89
+ The human skin is the body's largest organ.
90
+ Migration allows animals to find better resources.
91
+ The planet Jupiter has the most moons in our solar system.
92
+ The first law of thermodynamics states that energy cannot be created or destroyed, only converted from one form to another.
93
+ Apples are a type of fruit.
94
+ The currency used in Japan is the yen.
95
+ The planet Earth is the only planet known to support life.
96
+ The human eye can distinguish about 10 million different colors.
97
+ The world's largest mammal is the blue whale.
98
+ The Nile River is the longest river in the world.
99
+ Gravity makes things fall down.
100
+ A year on Earth is approximately 365.25 days long, which is why we have a leap year every four years.
101
+ Gravity is the force that attracts objects with mass towards each other.
102
+ The human liver helps filter toxins from the body.
103
+ Bees pollinate approximately one-third of the food we eat.
104
+ The longest highway in the world is the Pan-American Highway.
105
+ The fastest land animal is the cheetah.
106
+ The human immune system helps protect the body from infections.
107
+ Ecosystems consist of living organisms and their physical environment.
108
+ The fastest swimmer in the world is César Cielo from Brazil.
109
+ Electromagnetic induction is the process by which a changing magnetic field generates an electric current.
110
+ Tornadoes are rapidly rotating columns of air.
111
+ The Wright brothers made the first successful airplane flight.
112
+ Neurons are specialized cells that transmit electrical and chemical signals in the nervous system.
113
+ The circulatory system transports nutrients and oxygen throughout the body.
114
+ The Earth has four seasons: spring, summer, fall, and winter.
115
+ The study of living organisms and their interactions with the environment is called biology.
116
+ The distance from the Earth to the sun is approximately 93 million miles.
117
+ Dogs are known for being loyal pets.
118
+ The sky is often cloudy when it's going to rain.
119
+ Ice floats on water due to its lower density.
120
+ The three main types of neurons are sensory neurons, motor neurons, and interneurons.
121
+ The planet Earth is 4.54 billion years old.
122
+ The process of aging is influenced by both genetic and environmental factors.
123
+ Venus has a thick atmosphere.
124
+ The human heart pumps blood throughout the body.
125
+ The carbon cycle maintains the balance of carbon in Earth's atmosphere, oceans, and biosphere.
126
+ The Earth is located in the Milky Way galaxy.
127
+ Stars appear to twinkle due to Earth's atmosphere.
128
+ Cars need gasoline or electricity to run.
129
+ Black holes are regions in space with immense gravitational pull.
130
+ Diamonds are the hardest substance on Earth.
131
+ Vaccines help to prevent infectious diseases.
132
+ The Earth is the third planet from the sun.
133
+ The planet Pluto was reclassified as a dwarf planet in 2006.
134
+ Inertia is an object's resistance to change in motion.
135
+ Earth has one moon.
136
+ Ice cream is a popular dessert.
137
+ The largest country in the world by area is Russia.
138
+ Hybrids are the offspring of two plants or animals from different species or varieties.
139
+ Plants use photosynthesis to create energy from sunlight.
140
+ The largest mammal in the world is the blue whale.
141
+ The human body has 206 bones.
142
+ The planet Mercury is the closest planet to the sun in our solar system.
143
+ The smallest unit of life is the cell.
144
+ The process by which cells divide to form two identical daughter cells is called mitosis.
145
+ The Amazon rainforest is home to immense biodiversity.
146
+ The human respiratory system includes the trachea, bronchi, and lungs.
147
+ Photosynthesis in plants produces oxygen as a byproduct.
148
+ The smallest planet in our solar system is Mercury.
149
+ The study of the universe beyond Earth's atmosphere is called astronomy.
150
+ The human body has 12 pairs of ribs.
151
+ The Earth's ozone layer protects us from harmful ultraviolet (UV) radiation from the sun.
152
+ The first successful vaccine was created by Edward Jenner in 1796.
153
+ Camouflage helps animals blend with their environment.
154
+ Birds can fly.
155
+ The first Olympic Games were held in ancient Greece in 776 B.C.
156
+ Earth is 71% water.
157
+ Polar ice caps are primarily made of fresh water.
158
+ The human nervous system includes the brain, spinal cord, and nerves.
159
+ The scientific name for humans is Homo sapiens.
160
+ Radioactive decay occurs when unstable atomic nuclei release energy in the form of radiation.
161
+ The first animal to orbit Earth was a dog named Laika.
162
+ The color of an object depends on the wavelengths of light that it reflects.
163
+ The human brain is the control center for the body's functions and emotions.
164
+ The two main types of microscopes are light microscopes and electron microscopes.
165
+ The largest mammal on Earth is the blue whale.
166
+ The study of the Earth's physical structure, processes, and history is called geology.
167
+ The speed of light is 299,792,458 meters per second.
168
+ The longest mountain range in the world is the Andes.
169
+ Tornadoes are rapidly rotating columns of air that can cause extensive damage.
170
+ The speed of light is the fastest known speed in the universe.
171
+ The human respiratory system consists of lungs and airways.
172
+ The tallest tree in the world is a redwood tree named Hyperion.
173
+ The planet Venus is the hottest planet in our solar system.
174
+ The human body is approximately 60% water.
175
+ The planet Saturn is named after the Roman god of agriculture.
176
+ The largest country in the world by land area is Russia.
177
+ A group of fish is called a school.
178
+ Our solar system consists of eight planets: Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune.
179
+ Superconductors are materials that have no electrical resistance when cooled to certain temperatures.
180
+ Photosynthesis is the process by which plants convert sunlight into chemical energy.
181
+ Ice cream is a popular dessert.
182
+ The process by which a liquid turns into a gas is called evaporation.
183
+ The Roman Empire existed from 27 BC to 476 AD.
184
+ The primary colors of light are red, green, and blue.
185
+ Magnetism is a force that attracts or repels certain materials.
186
+ The study of matter and its interactions with energy is called physics.
187
+ Water is essential for life.
188
+ The planet Pluto has five known moons.
189
+ The scientific method is a process for testing hypotheses and acquiring knowledge.
190
+ The greenhouse effect helps regulate Earth's temperature.
191
+ Fossils are the preserved remains or traces of organisms that lived in the past.
192
+ Tides are caused by the gravitational interactions between the Earth, Moon, and Sun.
193
+ The planet Mars has the largest volcano in our solar system.
194
+ The process by which plants release oxygen and absorb carbon dioxide is called respiration.
195
+ The highest point in Africa is Mount Kilimanjaro.
196
+ Metamorphosis is a biological process in which an organism undergoes a significant change in form during its life cycle.
197
+ The boiling point of water decreases as altitude increases.
198
+ The speed of light is approximately 299,792,458 meters per second.
199
+ Rainbows form when light refracts through water droplets.
200
+ Jupiter is mostly made of hydrogen and helium.
201
+ The shortest month of the year is February.
202
+ Volcanoes form at areas where Earth's tectonic plates interact.
203
+ The three main types of chemical bonds are ionic, covalent, and metallic.
204
+ The respiratory system allows for the exchange of gases between the body and the environment.
205
+ Humans have five basic senses.
206
+ Honey is produced by bees.
207
+ A group of wolves is called a pack.
208
+ The human body is made up of bones, muscles, and organs.
209
+ Sound travels through the air as vibrations.
210
+ The Earth's rotation on its axis causes day and night.
211
+ The sun is a star.
212
+ The currency of Japan is the yen.
213
+ Antibiotics are used to treat bacterial infections.
214
+ The Great Wall of China is the longest wall in the world.
215
+ Iron rusts in the presence of oxygen and water.
216
+ Mars has the largest volcano, Olympus Mons.
217
+ Mitochondria are the "powerhouses" of cells, producing energy through cellular respiration.
218
+ The alphabet consists of 26 letters.
219
+ The Krebs cycle is a series of chemical reactions that generate energy in cells.
220
+ Diamonds are made of carbon.
221
+ The human body has 206 bones.
222
+ The auroras, or polar lights, are natural light displays caused by the interaction of solar particles with Earth's magnetic field.
223
+ The human digestive system breaks down food into nutrients.
224
+ The Sahara is the largest hot desert.
225
+ Lightning is a discharge of static electricity.
226
+ Humans need air, water, and food to survive.
227
+ The two main types of cells are prokaryotic (without a nucleus) and eukaryotic (with a nucleus).
228
+ Oxygen is necessary for humans to breathe.
229
+ Elephants are the largest land animals on Earth.
230
+ Diamonds are formed from carbon.
231
+ Seasons are caused by Earth's tilt.
232
+ The planet Neptune is the farthest planet from the sun in our solar system.
233
+ The human circulatory system is a closed system consisting of the heart, blood vessels, and blood.
234
+ The Earth's atmosphere is composed mostly of nitrogen and oxygen.
235
+ A group of lions is called a pride.
236
+ Evolution occurs through the process of natural selection.
237
+ Fermentation is a process by which microorganisms break down complex organic compounds.
238
+ Fossils provide evidence of past life on Earth.
239
+ Friction is the force that resists motion between two surfaces in contact.
240
+ The Pacific Ocean is the largest ocean in the world.
241
+ Mount Everest is the highest mountain in the world.
242
+ The oldest known human fossils are around 300,000 years old.
243
+ The capital of the United States is Washington, D.C.
244
+ Oxygen is essential for human life.
245
+ Oxygen is essential for respiration.
246
+ The Titanic was a famous ship that sank in 1912.
247
+ The atomic number of an element represents the number of protons in its nucleus.
248
+ Hibernation conserves energy during cold periods.
249
+ Rainbows are formed when light is refracted through water droplets in the air.
250
+ The human muscular system allows us to move and lift things.
251
+ The Sun is a star.
252
+ The Earth is round.
253
+ The Earth's magnetic field is what causes compasses to point north.
254
+ The Coriolis effect influences the movement of large-scale weather systems.
255
+ Sound travels faster through solids than through liquids or gases.
256
+ The first successful human heart transplant was performed in 1967.
257
+ The planet Mars is known as the "Red Planet" due to its reddish appearance.
258
+ Electromagnetic waves include radio waves, microwaves, infrared, visible light, ultraviolet, X-rays, and gamma rays.
259
+ Earthquakes are caused by the movement of tectonic plates.
260
+ The Earth orbits the Sun.
261
+ Water freezes at 0 degrees Celsius (32 degrees Fahrenheit) and boils at 100 degrees Celsius (212 degrees Fahrenheit).
262
+ The pH scale measures the acidity or alkalinity of a substance, ranging from 0 (most acidic) to 14 (most alkaline), with 7 being neutral.
263
+ The human reproductive system includes the ovaries, uterus, and testes.
264
+ The Hubble Space Telescope has provided valuable information about distant celestial objects.
265
+ The planet Uranus is tilted on its side.
266
+ The sun rises in the east and sets in the west.
267
+ A substance that cannot be broken down into simpler substances by chemical means is called an element.
268
+ The human skeleton provides support and protection for the body.
269
+ Saturn has thousands of rings.
270
+ The conservation of energy principle states that energy cannot be created or destroyed.
271
+ Sound travels through the air as waves.
272
+ Saturn's largest moon is Titan.
273
+ Light travels faster than sound.
274
+ The Earth has one moon.
275
+ Venus is similar in size to Earth.
276
+ Birds have feathers and wings.
277
+ The Milky Way is a spiral galaxy.
278
+ The Great Sphinx of Giza is an ancient statue in Egypt.
279
+ The human endocrine system produces hormones that regulate various bodily functions.
280
+ Lava is molten rock from volcanoes.
281
+ The Sahara Desert is the largest hot desert in the world.
282
+ Water is wet.
283
+ The human urinary system helps remove waste products from the body.
284
+ Sunflowers follow the movement of the sun across the sky.
285
+ Mercury has no moons.
286
+ The human liver can regenerate itself up to 75%.
287
+ Erosion is the gradual wearing away of Earth's surface by natural processes.
288
+ The Earth's largest ocean is the Pacific Ocean.
289
+ Volcanic eruptions can create new land.
290
+ The three types of rocks are igneous, sedimentary, and metamorphic.
291
+ Gravity pulls objects towards each other.
292
+ The sun rises in the east and sets in the west.
293
+ The human body has 206 bones.
294
+ The smallest continent in the world is Australia.
295
+ Trees absorb carbon dioxide and release oxygen.
296
+ The tallest building in the world is the Burj Khalifa in Dubai.
297
+ Butterflies go through a process called metamorphosis.
298
+ The planet Mars is named after the Roman god of war.
299
+ The largest ocean in the world is the Pacific Ocean.
300
+ The Mona Lisa is a famous painting by Leonardo da Vinci.
301
+ The first Olympic Games were held in ancient Greece in 776 BC.
302
+ Atoms are the basic building blocks of matter.
303
+ The four fundamental forces of nature are gravity, electromagnetism, the strong nuclear force, and the weak nuclear force.
304
+ The human body has four types of blood groups: A, B, AB, and O.
305
+ Convection is the transfer of heat through the movement of fluids or gases.
306
+ The human body has more than 600 muscles.