Views
No views yet
| Name | Quant method | Size |
|---|---|---|
| HelpingAI-3B-coder.Q2_K.gguf | Q2_K | 1.25GB |
| HelpingAI-3B-coder.Q3_K_S.gguf | Q3_K_S | 1.45GB |
| HelpingAI-3B-coder.Q3_K.gguf | Q3_K | 1.61GB |
| HelpingAI-3B-coder.Q3_K_M.gguf | Q3_K_M | 1.61GB |
| HelpingAI-3B-coder.Q3_K_L.gguf | Q3_K_L | 1.75GB |
| HelpingAI-3B-coder.IQ4_XS.gguf | IQ4_XS | 1.78GB |
| HelpingAI-3B-coder.Q4_0.gguf | Q4_0 | 1.86GB |
| HelpingAI-3B-coder.IQ4_NL.gguf | IQ4_NL | 1.87GB |
| HelpingAI-3B-coder.Q4_K_S.gguf | Q4_K_S | 1.88GB |
| HelpingAI-3B-coder.Q4_K.gguf | Q4_K | 1.99GB |
| HelpingAI-3B-coder.Q4_K_M.gguf | Q4_K_M | 1.99GB |
| HelpingAI-3B-coder.Q4_1.gguf | Q4_1 | 2.06GB |
| HelpingAI-3B-coder.Q5_0.gguf | Q5_0 | 2.25GB |
| HelpingAI-3B-coder.Q5_K_S.gguf | Q5_K_S | 2.25GB |
| HelpingAI-3B-coder.Q5_K.gguf | Q5_K | 2.32GB |
| HelpingAI-3B-coder.Q5_K_M.gguf | Q5_K_M | 2.32GB |
| HelpingAI-3B-coder.Q5_1.gguf | Q5_1 | 2.45GB |
| HelpingAI-3B-coder.Q6_K.gguf | Q6_K | 2.67GB |
| HelpingAI-3B-coder.Q8_0.gguf | Q8_0 | 3.45GB |

1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
3
4# Load the HelpingAI-3B-coder model
5model = AutoModelForCausalLM.from_pretrained("OEvortex/HelpingAI-3B-coder", trust_remote_code=True).to("cuda")
6
7# Load the tokenizer
8tokenizer = AutoTokenizer.from_pretrained("OEvortex/HelpingAI-3B-coder", trust_remote_code=True)
9
10# Initialize TextStreamer for smooth conversation flow
11streamer = TextStreamer(tokenizer)
12
13# Define the chat input
14chat = [
15 { "role": "system", "content": "You are HelpingAI, an emotionally intelligent AI. Always respond in the HelpingAI style. Provide concise and to-the-point answers." },
16 { "role": "user", "content": "Can you help me write a Python function to reverse a string?" }
17]
18
19# Apply the chat template
20chat_text = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
21
22# Tokenize the text
23inputs = tokenizer(chat_text, return_tensors="pt", return_attention_mask=False).to("cuda")
24
25# Generate text
26generated_text = model.generate(
27 **inputs,
28 max_length=500,
29 top_p=0.95,
30 do_sample=True,
31 temperature=0.7,
32 use_cache=True,
33 eos_token_id=tokenizer.eos_token_id,
34 streamer=streamer
35)
36
37# # Decode the generated text
38# output_text = tokenizer.decode(generated_text[0], skip_special_tokens=True)
39
40# # Print the generated text
41# print(output_text)
42
43# System:
44# You are HelpingAI, an emotional AI that always answers questions in HelpingAI style and always be to the point and answer as short as possible.
45
46# Question:
47# Can you help me write a Python function to reverse a string?
48
49# Answer:
50# Sure! Here's a Python function that reverses a string:
51
52# ```python
53# def reverse_string(input_string):
54# return input_string[::-1]
55# ```
56
57# This function uses slicing with a negative step to reverse the input string. The `[::-1]` syntax reverses the string by starting from the end and going backwards.
58
59# You can use this function like this:
60
61# ```python
62# print(reverse_string("Hello, World!"))
63# ```
64
65# This will output: `!dlroW,olleH`
66
67# I hope this helps! Let me know if you have any other questions.
68