File size: 7,520 Bytes
cb141fa
432d9be
 
e7e93a0
 
432d9be
 
 
 
30c6acc
 
 
 
 
 
d7b4dbf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
599b2b0
 
432d9be
30c6acc
599b2b0
b8c5f06
599b2b0
30c6acc
599b2b0
bcc6137
599b2b0
f0ee27b
 
 
 
 
 
6a88e94
f0ee27b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30c6acc
599b2b0
30c6acc
599b2b0
30c6acc
599b2b0
44d69fa
599b2b0
30c6acc
599b2b0
b8c5f06
c1c2d28
30c6acc
c1c2d28
b8c5f06
c1c2d28
30c6acc
c1c2d28
b8c5f06
c1c2d28
77de4de
fac90a8
1712a1a
30c6acc
c1c2d28
b8c5f06
c1c2d28
b8c5f06
599b2b0
d7b4dbf
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
language:
- en
license: apache-2.0
library_name: transformers
tags:
- code
- QA
- reasoning
- mixtral
- maths
- sql
- mistral
- zephyr
- codellama
model-index:
- name: Moe-4x7b-reason-code-qa
  results:
  - task:
      type: text-generation
      name: Text Generation
    dataset:
      name: AI2 Reasoning Challenge (25-Shot)
      type: ai2_arc
      config: ARC-Challenge
      split: test
      args:
        num_few_shot: 25
    metrics:
    - type: acc_norm
      value: 62.54
      name: normalized accuracy
    source:
      url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=nextai-team/Moe-4x7b-reason-code-qa
      name: Open LLM Leaderboard
  - task:
      type: text-generation
      name: Text Generation
    dataset:
      name: HellaSwag (10-Shot)
      type: hellaswag
      split: validation
      args:
        num_few_shot: 10
    metrics:
    - type: acc_norm
      value: 83.87
      name: normalized accuracy
    source:
      url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=nextai-team/Moe-4x7b-reason-code-qa
      name: Open LLM Leaderboard
  - task:
      type: text-generation
      name: Text Generation
    dataset:
      name: MMLU (5-Shot)
      type: cais/mmlu
      config: all
      split: test
      args:
        num_few_shot: 5
    metrics:
    - type: acc
      value: 61.2
      name: accuracy
    source:
      url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=nextai-team/Moe-4x7b-reason-code-qa
      name: Open LLM Leaderboard
  - task:
      type: text-generation
      name: Text Generation
    dataset:
      name: TruthfulQA (0-shot)
      type: truthful_qa
      config: multiple_choice
      split: validation
      args:
        num_few_shot: 0
    metrics:
    - type: mc2
      value: 56.12
    source:
      url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=nextai-team/Moe-4x7b-reason-code-qa
      name: Open LLM Leaderboard
  - task:
      type: text-generation
      name: Text Generation
    dataset:
      name: Winogrande (5-shot)
      type: winogrande
      config: winogrande_xl
      split: validation
      args:
        num_few_shot: 5
    metrics:
    - type: acc
      value: 76.09
      name: accuracy
    source:
      url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=nextai-team/Moe-4x7b-reason-code-qa
      name: Open LLM Leaderboard
  - task:
      type: text-generation
      name: Text Generation
    dataset:
      name: GSM8k (5-shot)
      type: gsm8k
      config: main
      split: test
      args:
        num_few_shot: 5
    metrics:
    - type: acc
      value: 54.59
      name: accuracy
    source:
      url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=nextai-team/Moe-4x7b-reason-code-qa
      name: Open LLM Leaderboard
---


Model Details

Model Name: Moe-4x7b-reason-code-qa Publisher: nextai-team Model Type: Question Answering & Code Generation Architecture: Mixture of Experts (MoE) Model Size: 4x7 billion parameters

Overview

 is an advanced AI model designed by the nextai-team for the purpose of enhancing question answering and code generation capabilities. Building upon the foundation of its predecessor, Moe-4x7b-reason-code-qa, this iteration introduces refined mechanisms and expanded training datasets to deliver more precise and contextually relevant responses.

How to Use

```from transformers import AutoTokenizer
import transformers
import torch

model = "nextai-team/Moe-4x7b-reason-code-qa" 

tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
    "text-generation",
    model=model,
    device_map="auto",
    model_kwargs={"torch_dtype": torch.float16},
)

def generate_resposne(query):
    messages = [{"role": "user", "content": query}]
    prompt = pipeline.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
    outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
    return outputs[0]['generated_text']

response = generate_resposne("How to learn coding .Please provide a step by step procedure")
print(response)

```

Intended Use

This model is intended for developers, data scientists, and researchers seeking to integrate sophisticated natural language understanding and code generation functionalities into their applications. Ideal use cases include but are not limited to:

Automated coding assistance Technical support bots Educational tools for learning programming Enhancing code review processes

Model Architecture  employs a Mixture of Experts (MoE) architecture, which allows it to efficiently manage its vast number of parameters for specialized tasks. This architecture facilitates the model's ability to discern subtle nuances in programming languages and natural language queries, leading to more accurate code generation and question answering performance.

Training Data The model has been trained on a diverse and extensive corpus comprising technical documentation, open-source code repositories, Stack Overflow questions and answers, and other programming-related texts. Special attention has been given to ensure a wide range of programming languages and frameworks are represented in the training data to enhance the model's versatility.

Performance  demonstrates significant improvements in accuracy and relevance over its predecessor, particularly in complex coding scenarios and detailed technical queries. Benchmarks and performance metrics can be provided upon request.

Limitations and Biases

While  represents a leap forward in AI-assisted coding and technical Q&A, it is not without limitations. The model may exhibit biases present in its training data, and its performance can vary based on the specificity and context of the input queries. Users are encouraged to critically assess the model's output and consider it as one of several tools in the decision-making process.

Ethical Considerations

We are committed to ethical AI development and urge users to employ Moe-4x7b-reason-code-qa responsibly. This includes but is not limited to avoiding the generation of harmful or unsafe code, respecting copyright and intellectual property rights, and being mindful of privacy concerns when inputting sensitive information into the model.

Demo API: 
app.nextai.co.in

Usage Instructions

For detailed instructions on how to integrate and utilize Moe-4x7b-reason-code-qa in your projects, please refer to our GitHub repository and Hugging Face documentation.

Citation If you use Moe-4x7b-reason-code-qa in your research or application, please cite it as follows:

@misc{nextai2024moe4x7b, title={Moe-4x7b-reason-code-qa: Enhancing Question Answering and Code Generation with Mixture of Experts}, author={NextAI Team}, year={2024}, publisher={Hugging Face} }
# [Open LLM Leaderboard Evaluation Results](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)
Detailed results can be found [here](https://huggingface.co/datasets/open-llm-leaderboard/details_nextai-team__Moe-4x7b-reason-code-qa)

|             Metric              |Value|
|---------------------------------|----:|
|Avg.                             |65.73|
|AI2 Reasoning Challenge (25-Shot)|62.54|
|HellaSwag (10-Shot)              |83.87|
|MMLU (5-Shot)                    |61.20|
|TruthfulQA (0-shot)              |56.12|
|Winogrande (5-shot)              |76.09|
|GSM8k (5-shot)                   |54.59|