nextai-team
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -36,6 +36,37 @@ for more accuracy and precision in general reasoning, QA and code.
|
|
36 |
|
37 |
### Model Sources
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
<!-- Provide the basic links for the model. -->
|
40 |
|
41 |
- **Demo :** Https://nextai.co.in
|
|
|
36 |
|
37 |
### Model Sources
|
38 |
|
39 |
+
https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2
|
40 |
+
https://huggingface.co/Intel/neural-chat-7b-v3-3
|
41 |
+
https://huggingface.co/HuggingFaceH4/zephyr-7b-beta
|
42 |
+
https://huggingface.co/teknium/OpenHermes-2.5-Mistral-7B
|
43 |
+
|
44 |
+
### Instructions to run the model
|
45 |
+
|
46 |
+
|
47 |
+
from transformers import AutoTokenizer
|
48 |
+
import transformers
|
49 |
+
import torch
|
50 |
+
|
51 |
+
model = "nextai-team/Moe-4x7b-reason-code-qa"
|
52 |
+
|
53 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
54 |
+
pipeline = transformers.pipeline(
|
55 |
+
"text-generation",
|
56 |
+
model=model,
|
57 |
+
model_kwargs={"torch_dtype": torch.float16, "load_in_4bit": True},
|
58 |
+
)
|
59 |
+
|
60 |
+
def generate_resposne(query):
|
61 |
+
messages = [{"role": "user", "content": query}]
|
62 |
+
prompt = pipeline.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
63 |
+
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
64 |
+
return outputs[0]['generated_text']
|
65 |
+
|
66 |
+
response = generate_resposne("How to start learning GenAI")
|
67 |
+
print(response)
|
68 |
+
|
69 |
+
|
70 |
<!-- Provide the basic links for the model. -->
|
71 |
|
72 |
- **Demo :** Https://nextai.co.in
|