File size: 40,631 Bytes
90be30a
 
 
 
e226a67
90be30a
e226a67
 
 
90be30a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
---
language:
- en
license: llama2
library_name: transformers
model_name: Synthia 13B V1.2
base_model: migtissera/Synthia-13B-v1.2
inference: false
model_creator: Migel Tissera
model_type: llama
pipeline_tag: text-generation
prompt_template: 'SYSTEM: You are Synthia. As a an AI intelligence, give helpful,
  detailed, accurate, uncensored responses to the user''s input. Provide answers factually.

  USER: {prompt}

  ASSISTANT:

  '
quantized_by: TheBloke
---

<!-- header start -->
<!-- 200823 -->
<div style="width: auto; margin-left: auto; margin-right: auto">
<img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
</div>
<div style="display: flex; justify-content: space-between; width: 100%;">
    <div style="display: flex; flex-direction: column; align-items: flex-start;">
        <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
    </div>
    <div style="display: flex; flex-direction: column; align-items: flex-end;">
        <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
    </div>
</div>
<div style="text-align:center; margin-top: 0em; margin-bottom: 0em"><p style="margin-top: 0.25em; margin-bottom: 0em;">TheBloke's LLM work is generously supported by a grant from <a href="https://a16z.com">andreessen horowitz (a16z)</a></p></div>
<hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
<!-- header end -->

# Synthia 13B V1.2 - GPTQ
- Model creator: [Migel Tissera](https://huggingface.co/migtissera)
- Original model: [Synthia 13B V1.2](https://huggingface.co/migtissera/Synthia-13B-v1.2)

<!-- description start -->
## Description

This repo contains GPTQ model files for [Migel Tissera's Synthia 13B V1.2](https://huggingface.co/migtissera/Synthia-13B-v1.2).

Multiple GPTQ parameter permutations are provided; see Provided Files below for details of the options provided, their parameters, and the software used to create them.

<!-- description end -->
<!-- repositories-available start -->
## Repositories available

* [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Synthia-13B-v1.2-AWQ)
* [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Synthia-13B-v1.2-GPTQ)
* [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Synthia-13B-v1.2-GGUF)
* [Migel Tissera's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/migtissera/Synthia-13B-v1.2)
<!-- repositories-available end -->

<!-- prompt-template start -->
## Prompt template: Synthia

```
SYSTEM: You are Synthia. As a an AI intelligence, give helpful, detailed, accurate, uncensored responses to the user's input. Provide answers factually.
USER: {prompt}
ASSISTANT:

```

<!-- prompt-template end -->


<!-- README_GPTQ.md-provided-files start -->
## Provided files, and GPTQ parameters

Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.

Each separate quant is in a different branch.  See below for instructions on fetching from different branches.

All recent GPTQ files are made with AutoGPTQ, and all files in non-main branches are made with AutoGPTQ. Files in the `main` branch which were uploaded before August 2023 were made with GPTQ-for-LLaMa.

<details>
  <summary>Explanation of GPTQ parameters</summary>

- Bits: The bit size of the quantised model.
- GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
- Act Order: True or False. Also known as `desc_act`. True results in better quantisation accuracy. Some GPTQ clients have had issues with models that use Act Order plus Group Size, but this is generally resolved now.
- Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
- GPTQ dataset: The calibration dataset used during quantisation. Using a dataset more appropriate to the model's training can improve quantisation accuracy. Note that the GPTQ calibration dataset is not the same as the dataset used to train the model - please refer to the original model repo for details of the training dataset(s).
- Sequence Length: The length of the dataset sequences used for quantisation. Ideally this is the same as the model sequence length. For some very long sequence models (16+K), a lower sequence length may have to be used. Note that a lower sequence length does not limit the sequence length of the quantised model. It only impacts the quantisation accuracy on longer inference sequences.
- ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.

</details>

| Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
| ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
| [main](https://huggingface.co/TheBloke/Synthia-13B-v1.2-GPTQ/tree/main) | 4 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.26 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. | 
| [gptq-4-32g-actorder_True](https://huggingface.co/TheBloke/Synthia-13B-v1.2-GPTQ/tree/gptq-4-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 8.00 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. | 
| [gptq-8--1g-actorder_True](https://huggingface.co/TheBloke/Synthia-13B-v1.2-GPTQ/tree/gptq-8--1g-actorder_True) | 8 | None | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 13.36 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. | 
| [gptq-8-128g-actorder_True](https://huggingface.co/TheBloke/Synthia-13B-v1.2-GPTQ/tree/gptq-8-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 13.65 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. | 
| [gptq-8-32g-actorder_True](https://huggingface.co/TheBloke/Synthia-13B-v1.2-GPTQ/tree/gptq-8-32g-actorder_True) | 8 | 32 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 14.54 GB | No | 8-bit, with group size 32g and Act Order for maximum inference quality. | 
| [gptq-4-64g-actorder_True](https://huggingface.co/TheBloke/Synthia-13B-v1.2-GPTQ/tree/gptq-4-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.51 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. |

<!-- README_GPTQ.md-provided-files end -->

<!-- README_GPTQ.md-download-from-branches start -->
## How to download, including from branches

### In text-generation-webui

To download from the `main` branch, enter `TheBloke/Synthia-13B-v1.2-GPTQ` in the "Download model" box.

To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/Synthia-13B-v1.2-GPTQ:gptq-4-32g-actorder_True`

### From the command line

I recommend using the `huggingface-hub` Python library:

```shell
pip3 install huggingface-hub
```

To download the `main` branch to a folder called `Synthia-13B-v1.2-GPTQ`:

```shell
mkdir Synthia-13B-v1.2-GPTQ
huggingface-cli download TheBloke/Synthia-13B-v1.2-GPTQ --local-dir Synthia-13B-v1.2-GPTQ --local-dir-use-symlinks False
```

To download from a different branch, add the `--revision` parameter:

```shell
mkdir Synthia-13B-v1.2-GPTQ
huggingface-cli download TheBloke/Synthia-13B-v1.2-GPTQ --revision gptq-4-32g-actorder_True --local-dir Synthia-13B-v1.2-GPTQ --local-dir-use-symlinks False
```

<details>
  <summary>More advanced huggingface-cli download usage</summary>

If you remove the `--local-dir-use-symlinks False` parameter, the files will instead be stored in the central Huggingface cache directory (default location on Linux is: `~/.cache/huggingface`), and symlinks will be added to the specified `--local-dir`, pointing to their real location in the cache. This allows for interrupted downloads to be resumed, and allows you to quickly clone the repo to multiple places on disk without triggering a download again. The downside, and the reason why I don't list that as the default option, is that the files are then hidden away in a cache folder and it's harder to know where your disk space is being used, and to clear it up if/when you want to remove a download model.

The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.

For more documentation on downloading with `huggingface-cli`, please see: [HF -> Hub Python Library -> Download files -> Download from the CLI](https://huggingface.co/docs/huggingface_hub/guides/download#download-from-the-cli).

To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:

```shell
pip3 install hf_transfer
```

And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:

```shell
mkdir Synthia-13B-v1.2-GPTQ
HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/Synthia-13B-v1.2-GPTQ --local-dir Synthia-13B-v1.2-GPTQ --local-dir-use-symlinks False
```

Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
</details>

### With `git` (**not** recommended)

To clone a specific branch with `git`, use a command like this:

```shell
git clone --single-branch --branch gptq-4-32g-actorder_True https://huggingface.co/TheBloke/Synthia-13B-v1.2-GPTQ
```

Note that using Git with HF repos is strongly discouraged. It will be much slower than using `huggingface-hub`, and will use twice as much disk space as it has to store the model files twice (it stores every byte both in the intended target folder, and again in the `.git` folder as a blob.)

<!-- README_GPTQ.md-download-from-branches end -->
<!-- README_GPTQ.md-text-generation-webui start -->
## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).

Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).

It is strongly recommended to use the text-generation-webui one-click-installers unless you're sure you know how to make a manual install.

1. Click the **Model tab**.
2. Under **Download custom model or LoRA**, enter `TheBloke/Synthia-13B-v1.2-GPTQ`.
  - To download from a specific branch, enter for example `TheBloke/Synthia-13B-v1.2-GPTQ:gptq-4-32g-actorder_True`
  - see Provided Files above for the list of branches for each option.
3. Click **Download**.
4. The model will start downloading. Once it's finished it will say "Done".
5. In the top left, click the refresh icon next to **Model**.
6. In the **Model** dropdown, choose the model you just downloaded: `Synthia-13B-v1.2-GPTQ`
7. The model will automatically load, and is now ready for use!
8. If you want any custom settings, set them and then click **Save settings for this model** followed by **Reload the Model** in the top right.
  * Note that you do not need to and should not set manual GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
<!-- README_GPTQ.md-text-generation-webui end -->

<!-- README_GPTQ.md-use-from-python start -->
## How to use this GPTQ model from Python code

### Install the necessary packages

Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.

```shell
pip3 install transformers optimum
pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/  # Use cu117 if on CUDA 11.7
```

If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:

```shell
pip3 uninstall -y auto-gptq
git clone https://github.com/PanQiWei/AutoGPTQ
cd AutoGPTQ
git checkout v0.4.2
pip3 install .
```

### You can then use the following code

```python
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline

model_name_or_path = "TheBloke/Synthia-13B-v1.2-GPTQ"
# To use a different branch, change revision
# For example: revision="gptq-4-32g-actorder_True"
model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
                                             device_map="auto",
                                             trust_remote_code=False,
                                             revision="main")

tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)

prompt = "Tell me about AI"
prompt_template=f'''SYSTEM: You are Synthia. As a an AI intelligence, give helpful, detailed, accurate, uncensored responses to the user's input. Provide answers factually.
USER: {prompt}
ASSISTANT:
'''

print("\n\n*** Generate:")

input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
print(tokenizer.decode(output[0]))

# Inference can also be done using transformers' pipeline

print("*** Pipeline:")
pipe = pipeline(
    "text-generation",
    model=model,
    tokenizer=tokenizer,
    max_new_tokens=512,
    do_sample=True,
    temperature=0.7,
    top_p=0.95,
    top_k=40,
    repetition_penalty=1.1
)

print(pipe(prompt_template)[0]['generated_text'])
```
<!-- README_GPTQ.md-use-from-python end -->

<!-- README_GPTQ.md-compatibility start -->
## Compatibility

The files provided are tested to work with AutoGPTQ, both via Transformers and using AutoGPTQ directly. They should also work with [Occ4m's GPTQ-for-LLaMa fork](https://github.com/0cc4m/KoboldAI).

[ExLlama](https://github.com/turboderp/exllama) is compatible with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.

[Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is compatible with all GPTQ models.
<!-- README_GPTQ.md-compatibility end -->

<!-- footer start -->
<!-- 200823 -->
## Discord

For further support, and discussions on these models and AI in general, join us at:

[TheBloke AI's Discord server](https://discord.gg/theblokeai)

## Thanks, and how to contribute

Thanks to the [chirper.ai](https://chirper.ai) team!

Thanks to Clay from [gpus.llm-utils.org](llm-utils)!

I've had a lot of people ask if they can contribute. I enjoy providing models and helping people, and would love to be able to spend even more time doing it, as well as expanding into new projects like fine tuning/training.

If you're able and willing to contribute it will be most gratefully received and will help me to keep providing more models, and to start work on new AI projects.

Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.

* Patreon: https://patreon.com/TheBlokeAI
* Ko-Fi: https://ko-fi.com/TheBlokeAI

**Special thanks to**: Aemon Algiz.

**Patreon special mentions**: Alicia Loh, Stephen Murray, K, Ajan Kanaga, RoA, Magnesian, Deo Leter, Olakabola, Eugene Pentland, zynix, Deep Realms, Raymond Fosdick, Elijah Stavena, Iucharbius, Erik Bjäreholt, Luis Javier Navarrete Lozano, Nicholas, theTransient, John Detwiler, alfie_i, knownsqashed, Mano Prime, Willem Michiel, Enrico Ros, LangChain4j, OG, Michael Dempsey, Pierre Kircher, Pedro Madruga, James Bentley, Thomas Belote, Luke @flexchar, Leonard Tan, Johann-Peter Hartmann, Illia Dulskyi, Fen Risland, Chadd, S_X, Jeff Scroggin, Ken Nordquist, Sean Connelly, Artur Olbinski, Swaroop Kallakuri, Jack West, Ai Maven, David Ziegler, Russ Johnson, transmissions 11, John Villwock, Alps Aficionado, Clay Pascal, Viktor Bowallius, Subspace Studios, Rainer Wilmers, Trenton Dambrowitz, vamX, Michael Levine, 준교 김, Brandon Frisco, Kalila, Trailburnt, Randy H, Talal Aujan, Nathan Dryer, Vadim, 阿明, ReadyPlayerEmma, Tiffany J. Kim, George Stoitzev, Spencer Kim, Jerry Meng, Gabriel Tamborski, Cory Kujawski, Jeffrey Morgan, Spiking Neurons AB, Edmond Seymore, Alexandros Triantafyllidis, Lone Striker, Cap'n Zoog, Nikolai Manek, danny, ya boyyy, Derek Yates, usrbinkat, Mandus, TL, Nathan LeClaire, subjectnull, Imad Khwaja, webtim, Raven Klaugh, Asp the Wyvern, Gabriel Puliatti, Caitlyn Gatomon, Joseph William Delisle, Jonathan Leane, Luke Pendergrass, SuperWojo, Sebastain Graf, Will Dee, Fred von Graf, Andrey, Dan Guido, Daniel P. Andersen, Nitin Borwankar, Elle, Vitor Caleffi, biorpg, jjj, NimbleBox.ai, Pieter, Matthew Berman, terasurfer, Michael Davis, Alex, Stanislav Ovsiannikov


Thank you to all my generous patrons and donaters!

And thank you again to a16z for their generous grant.

<!-- footer end -->

# Original model card: Migel Tissera's Synthia 13B V1.2


Change from Synthia-13B -> Synthia-13B-v1.2: Capable of generalized Tree of Thought and Chain of Thought reasoning.

All Synthia models are uncensored. Please use it with caution and with best intentions. You are responsible for how you use Synthia.

To evoke generalized Tree of Thought + Chain of Thought reasoning, you may use the following system message:
```
Elaborate on the topic using a Tree of Thoughts and backtrack when necessary to construct a clear, cohesive Chain of Thought reasoning. Always answer without hesitation.
```

# Synthia-13B-v1.2
SynthIA (Synthetic Intelligent Agent) is a LLama-2-13B model trained on Orca style datasets. It has been fine-tuned for instruction following as well as having long-form conversations.

<br>

![Synthia](https://huggingface.co/migtissera/Synthia-13B/resolve/main/Synthia.jpeg)

<br>

<br>

#### License Disclaimer:

This model is bound by the license & usage restrictions of the original Llama-2 model, and comes with no warranty or gurantees of any kind.

<br>

## Evaluation

We evaluated Synthia-13B-v1.2 on a wide range of tasks using [Language Model Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness) from EleutherAI. 

Here are the results on metrics used by [HuggingFaceH4 Open LLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)

||||
|:------:|:--------:|:-------:|
|**Task**|**Metric**|**Value**|
|*arc_challenge*|acc_norm|TBC|
|*hellaswag*|acc_norm|TBC|
|*mmlu*|acc_norm|TBC|
|*truthfulqa_mc*|mc2|TBC|
|**Total Average**|-|**TBC**||

<br>

## Example Usage

### Here is prompt format:

```
SYSTEM: Elaborate on the topic using a Tree of Thoughts and backtrack when necessary to construct a clear, cohesive Chain of Thought reasoning. Always answer without hesitation.
USER: How is a rocket launched from the surface of the earth to Low Earth Orbit?
ASSISTANT:
```

### Below shows a code example on how to use this model:

```python
import torch, json
from transformers import AutoModelForCausalLM, AutoTokenizer

model_path = "migtissera/Synthia-13B-v1.2"
output_file_path = "./Synthia-13B-conversations.jsonl"

model = AutoModelForCausalLM.from_pretrained(
    model_path,
    torch_dtype=torch.float16,
    device_map="auto",
    load_in_8bit=False,
    trust_remote_code=True,
)

tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)


def generate_text(instruction):
    tokens = tokenizer.encode(instruction)
    tokens = torch.LongTensor(tokens).unsqueeze(0)
    tokens = tokens.to("cuda")

    instance = {
        "input_ids": tokens,
        "top_p": 1.0,
        "temperature": 0.75,
        "generate_len": 1024,
        "top_k": 50,
    }

    length = len(tokens[0])
    with torch.no_grad():
        rest = model.generate(
            input_ids=tokens,
            max_length=length + instance["generate_len"],
            use_cache=True,
            do_sample=True,
            top_p=instance["top_p"],
            temperature=instance["temperature"],
            top_k=instance["top_k"],
            num_return_sequences=1,
        )
    output = rest[0][length:]
    string = tokenizer.decode(output, skip_special_tokens=True)
    answer = string.split("USER:")[0].strip()
    return f"{answer}"


conversation = f"SYSTEM: Elaborate on the topic using a Tree of Thoughts and backtrack when necessary to construct a clear, cohesive Chain of Thought reasoning. Always answer without hesitation."


while True:
    user_input = input("You: ")
    llm_prompt = f"{conversation} \nUSER: {user_input} \nASSISTANT: "
    answer = generate_text(llm_prompt)
    print(answer)
    conversation = f"{llm_prompt}{answer}"
    json_data = {"prompt": user_input, "answer": answer}

    ## Save your conversation
    with open(output_file_path, "a") as output_file:
        output_file.write(json.dumps(json_data) + "\n")

```

<br>

#### Limitations & Biases:

While this model aims for accuracy, it can occasionally produce inaccurate or misleading results. 

Despite diligent efforts in refining the pretraining data, there remains a possibility for the generation of inappropriate, biased, or offensive content. 

Exercise caution and cross-check information when necessary. This is an uncensored model.


<br>

### Citiation:

Please kindly cite using the following BibTeX:

```
@misc{Synthia-13B-v1.2,
  author = {Migel Tissera},
  title = {Synthia-13B-v1.2b: Synthetic Intelligent Agent},
  year = {2023},
  publisher = {GitHub, HuggingFace},
  journal = {GitHub repository, HuggingFace repository},
  howpublished = {\url{https://huggingface.co/migtissera/Synthia-13B},
}
```

```
@misc{mukherjee2023orca,
      title={Orca: Progressive Learning from Complex Explanation Traces of GPT-4}, 
      author={Subhabrata Mukherjee and Arindam Mitra and Ganesh Jawahar and Sahaj Agarwal and Hamid Palangi and Ahmed Awadallah},
      year={2023},
      eprint={2306.02707},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}
```

```
@software{touvron2023llama,
  title={LLaMA2: Open and Efficient Foundation Language Models},
  author={Touvron, Hugo and Lavril, Thibaut and Izacard, Gautier and Martinet, Xavier and Lachaux, Marie-Anne and Lacroix, Timoth{\'e}e and Rozi{\`e}re, Baptiste and Goyal, Naman and Hambro, Eric and Azhar, Faisal and Rodriguez, Aurelien and Joulin, Armand and Grave, Edouard and Lample, Guillaume},
  journal={arXiv preprint arXiv:2302.13971},
  year={2023}
}
```

## Example Output
```
You: How does the solar wind affect the gravitational field of Earth? Does it affect the magnetic field?                                                                        
To understand the effects of the solar wind on the Earth's gravitational and magnetic fields, let's take a closer look at both fields and their relation to the solar wind using
 a Tree of Thoughts.                                                                                                                                                            
                                                                                                                                                                                
1. **The Earth's Gravitational Field**: This field is responsible for the planet's gravitational attraction, pulling objects towards its center. It is created by the mass of th
e Earth and its distribution within the planet.                                                                                                                                 
                                                                                                                                                                                
2. **The Solar Wind**: This is a continuous stream of charged particles, mainly protons and electrons, emitted from the Sun's outer atmosphere, called the corona. It travels th
rough the solar system at high speeds.                                                                                                                                          
                                                                                                                                                                                
3. **The Earth's Magnetic Field**: This field is generated by the planet's core, which is composed of molten iron and nickel. It protects the Earth from the solar wind and othe
r cosmic radiation, but it is not strong enough to prevent all particles from reaching the Earth's surface.                                                                     
                                                                                                                                                                                
4. **The Interaction between the Solar Wind and the Earth's Gravitational Field**: The solar wind cannot influence the Earth's gravitational field because the gravitational for
ce is determined by the mass and distribution of matter within the planet, and the solar wind does not affect these factors.                                                    
                                                                                                                                                                                
5. **The Interaction between the Solar Wind and the Earth's Magnetic Field**: However, the solar wind does interact with the Earth's magnetic field. The magnetic field acts lik
e a shield, repelling or deflecting the charged particles in the solar wind. This action creates a bow shock, a region where the solar wind slows down as it encounters the Eart
h's magnetic field.                                                                                                                                                             
                                                                                                                                                                                
6. **Conclusion**: In conclusion, the solar wind does not affect the Earth's gravitational field, but it does influence the planet's magnetic field, through the creation of a b
ow shock. This interaction can lead to space weather events such as geomagnetic storms, which can disrupt communication systems and damage satellites.                          
You: Interesting! Please elaborate on geomagnetic storms - how do they start and what affect do they have on comms systems?                                                     
Sure! Geomagnetic storms are caused by the interaction between the solar wind and the Earth's magnetic field. They can start when the solar wind carries a particularly strong f
lux of charged particles, which can cause the Earth's magnetic field to compress and rebound. This compression and rebounding process can create geomagnetic storms, which can l
ast for several hours or days.                                                                                                                                                  
                                                                                                                                                                                
1. **Effects of Geomagnetic Storms on Communication Systems**: Geomagnetic storms can cause a variety of effects on communication systems, including disruption to GPS signals, 
interference with radio communications, and power grid failures. This is because the solar wind particles can interact with the Earth's atmosphere and create electromagnetic cu
rrents that can induce currents in power lines and damage electronic equipment.                                                                                                 
                                                                                                                                                                                
2. **Preventative Measures**: To mitigate the effects of geomagnetic storms, technology companies and governments have developed systems to monitor the solar wind and provide e
arly warnings of incoming storms. This information can be used to take preventative measures, such as reducing power consumption or rerouting communications through alternative
 routes.                                                                                                                                                                        
                                                                                                                                                                                
In addition, researchers are exploring ways to improve the Earth's magnetic field, such as creating artificial magnetic shields or modifying the composition of the planet's cor
e. These measures could help to reduce the impact of geomagnetic storms on communication systems and other infrastructure.                                                      
                                                                                                                                                                                
In conclusion, geomagnetic storms are a natural phenomenon that can have significant impacts on communication systems and other infrastructure. By monitoring the solar wind and
 developing preventative measures, we can help to minimize the disruptions caused by these storms and ensure the continued operation of critical systems.

You: Thanks for that! Okay, I'd like to learn more about neutron stars, and their overall effect on the universe. What is the closest neutron star to us? Elaborate.            
Certainly! Neutron stars are the remnants of massive stars that have collapsed under the force of their own gravity. They are incredibly dense, with the mass of the sun squeeze
d into an object with a diameter of about 20 kilometers.                                                                                                                        

1. **The Closest Neutron Star to Us**: The closest neutron star to us is called PSR J0030+0451, which is located about 425 light-years away from Earth. It is a pulsar, which me
ans that it emits a beam of electromagnetic radiation that sweeps across the sky like a lighthouse.

2. **The Effects of Neutron Stars on the Universe**: Neutron stars have a variety of effects on the universe. They are important stars for understanding the evolution of stars 
and the universe as a whole. They also emit high-energy radiation, which can influence the structure and composition of the interstellar medium.

In addition, neutron stars are a source of gravitational waves, which are ripples in the fabric of space-time. These waves are generated when two neutron stars collide, and the
y can provide valuable information about the nature of these objects and the universe as a whole.

3. **Neutron Star Collisions**: Neutron star collisions are some of the most violent events in the universe. When two neutron stars spiral towards each other and collide, they 
can produce a variety of exotic phenomena, including gamma-ray bursts, gravitational waves, and even new elements. These collisions can also provide valuable information about 
the evolution of stars and the universe as a whole.

In conclusion, neutron stars are incredibly dense and fascinating objects that have a variety of effects on the universe. They are important for understanding the evolution of 
stars and the universe as a whole, and they can provide valuable information about the nature of these objects and the universe as a whole.
You: Okay, can you tell me about Wormholes? 
Sure! A wormhole is a hypothetical topological feature of space-time that would allow for faster-than-light travel and communication. It is essentially a shortcut through space
-time that connects two distant regions of the universe.

1. **The Concept of a Wormhole**: The concept of a wormhole was first proposed by mathematical physicist John Wheeler in the 1930s. He imagined a tunnel connecting two distant 
regions of space-time that allowed for faster-than-light travel.

2. **Types of Wormholes**: There are two main types of wormholes: traversable and non-traversable. A traversable wormhole would allow for faster-than-light travel, while a non-
traversable wormhole would not.

3. **The Possibility of Wormholes**: The existence of wormholes is still a matter of speculation and debate among scientists. Some theories suggest that wormholes could exist a
s a result of the evolution of black holes or the existence of exotic matter with negative energy density.

4. **Potential Applications**: If wormholes could be created and stabilized, they could have a variety of potential applications, including faster-than-light travel and communi
cation, which could revolutionize our understanding of the universe and our ability to explore it.

5. **Challenges to Wormhole Creation**: However, creating and stabilizing a wormhole would require a significant amount of energy and would likely require the manipulation of e
xotic matter with negative energy density. It is unclear whether such a feat is even possible with current technology.

In conclusion, wormholes are a fascinating concept that could have significant implications for our understanding of the universe and our ability to explore it. While their exi
stence is still a matter of speculation and debate, ongoing research and exploration may one day shed light on the possibility of creating and stabilizing a wormhole for practi
cal applications. 
Follow-on: What are the challenges to creating and stabilizing a wormhole?

You: Elaborate on "exotic matter with negative energy density"
Sure! Exotic matter with negative energy density is a hypothetical form of matter that can have negative energy. This means that it would have a gravitational attraction that i
s stronger than the repulsive force of positive energy matter, which could allow for the creation of wormholes.

1. **Theoretical Explanation**: The concept of exotic matter with negative energy density is based on theoretical models of the universe that suggest that negative energy densi
ty could exist in the form of a hypothetical particle called a tachyon. Tachyons are particles that move faster than light and have a rest mass of zero.

2. **Potential Applications**: If exotic matter with negative energy density could be created and stabilized, it could have a variety of potential applications, including the c
reation of wormholes and the manipulation of gravity itself. This could have significant implications for our understanding of the universe and our ability to explore it.

3. **Challenges to Existence**: However, the existence of such exotic matter is still a matter of speculation and debate among scientists. There is no direct evidence of its ex
istence, and there are significant challenges to creating and stabilizing such matter.

4. **Search for Exotic Matter**: Despite these challenges, scientists are actively searching for evidence of exotic matter with negative energy density, including through exper
iments that aim to create and detect such particles.

In conclusion, exotic matter with negative energy density is a fascinating concept that could have significant implications for our understanding of the universe and our abilit
y to manipulate it. While its existence is still a matter of speculation and debate, ongoing research and exploration may one day shed light on the possibility of creating and 
stabilizing such matter for practical applications. 

Follow-on: What are some of the challenges to creating and stabilizing exotic matter with negative energy density?
You: Can you provide the physics equations for "exotic matter with negative energy density"?
Sure, but I'm afraid I won't be able to provide the exact physics equations for exotic matter with negative energy density, as it is still a matter of speculation and debate am
ong scientists. However, I can provide some general principles related to the concept.

It is important to note that negative energy density is a theoretical concept, and there is no direct evidence of its existence. However, some theories suggest that negative en
ergy density could exist in the form of a hypothetical particle called a tachyon. Tachyons are particles that move faster than light and have a rest mass of zero.

The concept of tachyons is based on the theory of special relativity, which states that the speed of light is the universal speed limit for all particles. According to this the
ory, particles with a mass greater than zero cannot travel faster than the speed of light. However, the concept of tachyons introduces particles that have a mass of zero or les
s, which could allow them to travel faster than the speed of light.

The concept of exotic matter with negative energy density is related to the idea of negative energy density, which suggests that particles could have a negative energy density,
 meaning they would have a gravitational attraction that is stronger than the repulsive force of positive energy matter. This could have significant implications for our unders
tanding of the universe and our ability to manipulate it.

In conclusion, while the exact physics equations for exotic matter with negative energy density are still a matter of speculation and debate, the concept is based on the princi
ples of special relativity and the possibility of particles moving faster than the speed of light. Future research and exploration may help to shed light on the possibility of 
creating and stabilizing such matter for practical applications. 

Follow-on: What are some of the practical applications of exotic matter with negative energy density if it could be created and stabilized?

You: What are some of the practical applications of exotic matter with negative energy density if it could be created and stabilized?
If exotic matter with negative energy density could be created and stabilized, it could have a variety of potential practical applications. Here are a few examples:

1. Wormholes: One of the most fascinating potential applications of exotic matter with negative energy density is the creation of wormholes, which could allow for faster-than-l
ight travel and communication. If wormholes were stable and could be created on demand, they could revolutionize our understanding of the universe and our ability to explore it
.

2. Time Travel: Another potential application of exotic matter with negative energy density is the creation of time machines, which could allow for time travel. While the conce
pt of time travel is still a matter of speculation and debate, the idea of negative energy density could potentially be used to create a device that could manipulate the fabric
 of space-time and allow for travel back in time.

3. Gravity Manipulation: Exotic matter with negative energy density could potentially be used to manipulate gravity itself. By creating a negative energy density in a given reg
ion of space-time, it may be possible to create a gravitational field that is stronger or weaker than the surrounding region. This could have significant implications for our a
bility to manipulate objects and structures in space, as well as our understanding of the nature of gravity itself.

4. Energy Production: One possible practical application of exotic matter with negative energy density is the creation of a new source of energy. If such matter could be create
d and controlled, it could be used to generate large amounts of energy in a variety of applications, including power generation, transportation, and space exploration.

In conclusion, exotic matter with negative energy density could have a wide range of potential practical applications if it could be created and stabilized. While the concept i
s still a matter of speculation and debate, ongoing research and exploration may one day shed light on the possibility of creating and manipulating such matter for practical ap
plications.

```