Text Generation
Transformers
Safetensors
GGUF
Vietnamese
gemma
education
text-generation-inference
llama-factory
unsloth
Instructions to use IAmSkyDra/GemSUra-edu with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use IAmSkyDra/GemSUra-edu with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="IAmSkyDra/GemSUra-edu")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("IAmSkyDra/GemSUra-edu") model = AutoModelForCausalLM.from_pretrained("IAmSkyDra/GemSUra-edu") - llama-cpp-python
How to use IAmSkyDra/GemSUra-edu with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="IAmSkyDra/GemSUra-edu", filename="unsloth.F16.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use IAmSkyDra/GemSUra-edu with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf IAmSkyDra/GemSUra-edu:F16 # Run inference directly in the terminal: llama cli -hf IAmSkyDra/GemSUra-edu:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf IAmSkyDra/GemSUra-edu:F16 # Run inference directly in the terminal: llama cli -hf IAmSkyDra/GemSUra-edu:F16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf IAmSkyDra/GemSUra-edu:F16 # Run inference directly in the terminal: ./llama-cli -hf IAmSkyDra/GemSUra-edu:F16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf IAmSkyDra/GemSUra-edu:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf IAmSkyDra/GemSUra-edu:F16
Use Docker
docker model run hf.co/IAmSkyDra/GemSUra-edu:F16
- LM Studio
- Jan
- vLLM
How to use IAmSkyDra/GemSUra-edu with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "IAmSkyDra/GemSUra-edu" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IAmSkyDra/GemSUra-edu", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/IAmSkyDra/GemSUra-edu:F16
- SGLang
How to use IAmSkyDra/GemSUra-edu with 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 "IAmSkyDra/GemSUra-edu" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IAmSkyDra/GemSUra-edu", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "IAmSkyDra/GemSUra-edu" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IAmSkyDra/GemSUra-edu", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use IAmSkyDra/GemSUra-edu with Ollama:
ollama run hf.co/IAmSkyDra/GemSUra-edu:F16
- Unsloth Studio
How to use IAmSkyDra/GemSUra-edu with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for IAmSkyDra/GemSUra-edu to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for IAmSkyDra/GemSUra-edu to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for IAmSkyDra/GemSUra-edu to start chatting
- Atomic Chat new
- Docker Model Runner
How to use IAmSkyDra/GemSUra-edu with Docker Model Runner:
docker model run hf.co/IAmSkyDra/GemSUra-edu:F16
- Lemonade
How to use IAmSkyDra/GemSUra-edu with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull IAmSkyDra/GemSUra-edu:F16
Run and chat with the model
lemonade run user.GemSUra-edu-F16
List all available models
lemonade list
| license: apache-2.0 | |
| datasets: | |
| - IAmSkyDra/HCMUT_FAQ | |
| language: | |
| - vi | |
| tags: | |
| - education | |
| - text-generation-inference | |
| - gemma | |
| - llama-factory | |
| - unsloth | |
| widget: | |
| - text: Chào bạn | |
| output: | |
| text: >- | |
| Chào bạn! Tôi là GemSUra-edu, một trợ lý AI được phát triển bởi Long | |
| Nguyen. | |
| example_title: Query 1 | |
| - text: Hiệu trưởng hiện tại của trường Đại học Bách Khoa | |
| output: | |
| text: >- | |
| Hiệu trưởng hiện tại của trường Đại học Bách Khoa là PGS. TS. Mai Thanh Phong. | |
| example_title: Query 2 | |
| - text: OISP là viết tắt của | |
| output: | |
| text: >- | |
| Văn phòng Đào tạo Quốc tế (Office for International Study Programs) | |
| example_title: Query 3 | |
| ## Introduction | |
| GemSUra-edu is a large language model fine-tuned on a dataset of FAQs from HCMUT, based on the pre-trained model [GemSUra 2B](https://huggingface.co/ura-hcmut/GemSUra-2B) developed by the URA research group at Ho Chi Minh City University of Technology (HCMUT). | |
| ## Inference (with Unsloth for higher speed) | |
| ```python | |
| from unsloth import FastLanguageModel | |
| import torch | |
| # Load model and tokenizer | |
| model, tokenizer = FastLanguageModel.from_pretrained( | |
| model_name="IAmSkyDra/GemSUra-edu", | |
| max_seq_length=4096, | |
| dtype=None, | |
| load_in_4bit=True | |
| ) | |
| FastLanguageModel.for_inference(model) | |
| query_template = "<start_of_turn>user\n{query}<end_of_turn>\n<start_of_turn>model\n" | |
| while True: | |
| query = input("Query: ") | |
| if query.lower() == "exit": | |
| break | |
| query = query_template.format(query=query) | |
| inputs = tokenizer(query, return_tensors="pt") | |
| outputs = model.generate(**inputs, max_new_tokens=4096, use_cache=True) | |
| generated_text = tokenizer.batch_decode(outputs, skip_special_tokens=True) | |
| answer = generated_text[0].split("model\n")[1].strip() | |
| print(answer) | |
| ``` | |
| ## Inference (with Transformers) | |
| ```python | |
| import transformers | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| pipeline_kwargs = { | |
| "temperature": 0.1, | |
| "max_new_tokens": 4096, | |
| "do_sample": True | |
| } | |
| if __name__ == "__main__": | |
| # Load model | |
| model = AutoModelForCausalLM.from_pretrained( | |
| "IAmSkyDra/GemSUra-edu", | |
| device_map="auto" | |
| ) | |
| model.eval() | |
| # Load tokenizer | |
| tokenizer = AutoTokenizer.from_pretrained( | |
| "IAmSkyDra/GemSUra-edu", | |
| trust_remote_code=True | |
| ) | |
| pipeline = transformers.pipeline( | |
| model=model, | |
| tokenizer=tokenizer, | |
| return_full_text=False, | |
| task='text-generation', | |
| **pipeline_kwargs | |
| ) | |
| query_template = "<start_of_turn>user\n{query}<end_of_turn>\n<start_of_turn>model\n" | |
| while True: | |
| query = input("Query: ") | |
| if query.lower() == "exit": | |
| break | |
| query = query_template.format(query=query) | |
| answer = pipeline(query)[0]["generated_text"] | |
| answer = answer.split("model\n")[1].strip() | |
| print(answer) | |
| ``` | |
| ## Notation | |
| If you want to quantize the model for deployment on local devices, it should be quantized to at least 8 bits. |