How to use from
SGLang
Install from pip and serve model
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
    --model-path "Neurai/NeuraOrcaGemma7b" \
    --host 0.0.0.0 \
    --port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
	-H "Content-Type: application/json" \
	--data '{
		"model": "Neurai/NeuraOrcaGemma7b",
		"messages": [
			{
				"role": "user",
				"content": "What is the capital of France?"
			}
		]
	}'
Use Docker images
docker run --gpus all \
    --shm-size 32g \
    -p 30000:30000 \
    -v ~/.cache/huggingface:/root/.cache/huggingface \
    --env "HF_TOKEN=<secret>" \
    --ipc=host \
    lmsysorg/sglang:latest \
    python3 -m sglang.launch_server \
        --model-path "Neurai/NeuraOrcaGemma7b" \
        --host 0.0.0.0 \
        --port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
	-H "Content-Type: application/json" \
	--data '{
		"model": "Neurai/NeuraOrcaGemma7b",
		"messages": [
			{
				"role": "user",
				"content": "What is the capital of France?"
			}
		]
	}'
Quick Links

Neura Orca Gemma 7B

Model Description

  • Developed by: Neura company
  • Funded by: Neura
  • Model type: gemma7b
  • Language(s) (NLP): Persian
  • Finetuned from model: google/gemma-7b-it

Model Sources

Uses

Check out the Google Colab demo to run NeuraOrcaGemma7b on a free-tier Google Colab instance: Open In Colab

make sure these packages are installed:

!pip install --no-deps xformers accelerate bitsandbytes
!pip install -q -U transformers
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
import torch
import os
MODEL_PATH = "Neurai/NeuraOrcaGemma7b"
quantization_config = BitsAndBytesConfig(
    load_in_4bit = True,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_compute_dtype=torch.bfloat16,
    bnb_4bit_use_double_quant=True,
)

model = AutoModelForCausalLM.from_pretrained(
    MODEL_PATH,
    device_map = "auto",
    trust_remote_code = True,
    quantization_config=quantization_config,
)

tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH)

input_prompt = """
### Instruction:{}
### Input:{}
### Response:{}"""

input_text = input_prompt.format(
        "در مورد سری فوریه بهم توضیح میدی و فرمولش رو برام مینویسی", 
        "", 
        ""
    )

inputs = tokenizer([input_text], return_tensors = "pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens = 300, use_cache = True)
response = tokenizer.batch_decode(outputs)[0]

Generated text :

 سری فوریه یک سری ریاضی است که برای نمایش یک تابع پیوسته و متناوب در یک بازه زمانی معین استفاده می شود. این نام از ریاضیدان فرانسوی آگوستین-لویی کوشی گرفته شده است که آن را در سال 1826 معرفی کرد.

فرمول سری فوریه به صورت زیر است:

f(x) = a0 + sum(an * cos(n*pi*x/L)) + sum(bn * sin(n*pi*x/L))

که در آن:

- f(x) تابع پیوسته و متناوب در بازه زمانی [(-L/2, L/2] است
- a0 مقدار میانگین مربع f(x) در بازه زمانی [(-L/2, L/2] است
- an ضریب سری برای n-th term است
- bn ضریب سری برای n-th term است
- L طول بازه زمانی است
- n یک عدد صحیح مثبت است
- x یک متغیر واقعی است
- pi (pi) یک ثابت ریاضی است

برای یافتن ضرایب سری، باید f(x) را در بازه زمانی [(-L/2, L/2] با استفاده از فرمول های زیر تجزیه کنیم:

an = (1/L) * int(-L/2, L/2) f(x) * cos(n*pi*x/L) dx
bn = (1/L) * int(-L/2, L/2) f(x) * sin(n*pi*x/L) dx

که در آن:

- int نشان دهنده انتگرال است
- L طول بازه زمانی است
- n یک عدد صحیح مثبت است
- x یک متغیر واقعی است
- f(x) تابع پیوسته و متناوب در بازه زمانی [(-L/2, L/2] است
- pi (pi) یک ثابت ریاضی است

پس از یافتن ضرایب سری، می توان از فرمول سری فوریه برای نمایش f(x) در بازه زمانی [(-L/2, L/2] استفاده کرد.<eos>

More Information

https://neura.info

Model Card Authors

Esmaeil Zahedi, Mohsen Yazdinejad

Model Card Contact

info@neura.info

Downloads last month
42
Safetensors
Model size
9B params
Tensor type
F32
·
F16
·
U8
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train Neurai/NeuraOrcaGemma7b