Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
train: false
|
4 |
+
inference: false
|
5 |
+
pipeline_tag: text-generation
|
6 |
+
---
|
7 |
+
## Mixtral-8x7B-Instruct-v0.1-hf-attn-4bit-moe-2bit-HQQ
|
8 |
+
This is a version of the Mixtral-8x7B-Instruct-v0.1 model (https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1) quantized with a mix of 4-bit and 2-bit via Half-Quadratic Quantization (HQQ).
|
9 |
+
|
10 |
+
More specifically, the attention layers are quantized to 4-bit and the experts are quantized to 2-bit.
|
11 |
+
This model should perform a lot better compared to the all 2-bit model for a slight increase in model size (18.2GB vs. 18GB).
|
12 |
+
|
13 |
+
### Basic Usage
|
14 |
+
To run the model, install the HQQ library from https://github.com/mobiusml/hqq and use it as follows:
|
15 |
+
``` Python
|
16 |
+
model_id = 'mobiuslabsgmbh/Mixtral-8x7B-Instruct-v0.1-hf-attn-4bit-moe-2bit-HQQ'
|
17 |
+
#Load the model
|
18 |
+
from hqq.engine.hf import HQQModelForCausalLM, AutoTokenizer
|
19 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
20 |
+
model = HQQModelForCausalLM.from_quantized(model_id)
|
21 |
+
#Optional
|
22 |
+
from hqq.core.quantize import *
|
23 |
+
HQQLinear.set_backend(HQQBackend.PYTORCH_COMPILE)
|
24 |
+
#Text Generation
|
25 |
+
prompt = "<s> [INST] How do I build a car? [/INST] "
|
26 |
+
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False)
|
27 |
+
outputs = model.generate(**(inputs.to('cuda')), max_new_tokens=1000)
|
28 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
29 |
+
```
|
30 |
+
<b>Output</b>:
|
31 |
+
<p>
|
32 |
+
|
33 |
+
1. Design the Car:
|
34 |
+
* Determine the type of car you want to build (e.g., sedan, SUV, sports car) and its specifications (e.g., size, weight, horsepower, fuel efficiency).
|
35 |
+
* Create detailed sketches and 3D models of the car's exterior and interior.
|
36 |
+
* Design the car's technical components, including the engine, transmission, brakes, and suspension system.
|
37 |
+
|
38 |
+
2. Acquire Necessary Materials and Parts:
|
39 |
+
* Purchase or manufacture the necessary materials, such as steel, aluminum, and plastics.
|
40 |
+
* Obtain or manufacture the required parts, such as the engine, transmission, brakes, suspension system, and electrical components.
|
41 |
+
|
42 |
+
3. Set Up a Production Facility:
|
43 |
+
* Establish a manufacturing facility with the necessary equipment, such as assembly lines, paint booths, and welding machines.
|
44 |
+
* Hire a skilled workforce to oversee production and ensure quality control.
|
45 |
+
|
46 |
+
4. Manufacture the Car:
|
47 |
+
* Follow the design specifications to assemble the car's components.
|
48 |
+
* Perform rigorous testing to ensure the car meets safety and performance standards.
|
49 |
+
|
50 |
+
5. Market and Sell the Car:
|
51 |
+
* Develop a marketing strategy to promote the car to potential buyers.
|
52 |
+
* Establish a distribution network to sell the car through dealerships or online platforms.
|
53 |
+
|
54 |
+
6. Provide After-Sales Support:
|
55 |
+
* Offer maintenance and repair services to ensure customer satisfaction and loyalty.
|
56 |
+
* Continuously improve the car's design and performance based on customer feedback and market trends.
|
57 |
+
|
58 |
+
Please note, building a car requires significant expertise, resources, and adherence to strict safety and regulatory standards. It is not a project that can be undertaken without extensive knowledge and experience in automotive engineering, manufacturing, and business management.
|
59 |
+
|
60 |
+
----------------------------------------------------------------------------------------------------------------------------------
|
61 |
+
</p>
|