Text Generation
Transformers
Safetensors
English
text-generation-inference
unsloth
mistral
trl
question-generation
Instructions to use kanoza/fine_tuned_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kanoza/fine_tuned_model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kanoza/fine_tuned_model")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("kanoza/fine_tuned_model", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use kanoza/fine_tuned_model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kanoza/fine_tuned_model" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kanoza/fine_tuned_model", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/kanoza/fine_tuned_model
- SGLang
How to use kanoza/fine_tuned_model 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 "kanoza/fine_tuned_model" \ --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": "kanoza/fine_tuned_model", "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 "kanoza/fine_tuned_model" \ --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": "kanoza/fine_tuned_model", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Desktop
- Docker Model Runner
How to use kanoza/fine_tuned_model with Docker Model Runner:
docker model run hf.co/kanoza/fine_tuned_model
|
Download README.md from kanoza/fine_tuned_model: direct link, hf CLI and curl.
- Browser
- Download file 4.54 kB
-
https://huggingface.co/kanoza/fine_tuned_model/resolve/main/README.md
- Command line
-
hf download hf://kanoza/fine_tuned_model/README.md
-
curl -L -o README.md https://huggingface.co/kanoza/fine_tuned_model/resolve/main/README.md
4.54 kB
| base_model: unsloth/mistral-nemo-base-2407-bnb-4bit | |
| tags: | |
| - text-generation-inference | |
| - transformers | |
| - unsloth | |
| - mistral | |
| - trl | |
| - question-generation | |
| license: apache-2.0 | |
| language: | |
| - en | |
| pipeline_tag: text-generation | |
| inference: true | |
| framework: pytorch | |
| widgets: | |
| - inputs: | |
| instruction: >- | |
| Generate a multiple-choice question (MCQ) based on the passage, provide | |
| options, and indicate the correct option. | |
| context: >- | |
| Photosynthesis is the process by which plants convert sunlight into | |
| energy. | |
| outputs: | |
| question: What is the primary process by which plants convert sunlight into energy? | |
| options: | |
| - A. Photosynthesis | |
| - B. Respiration | |
| - C. Fermentation | |
| - D. Transpiration | |
| correct_option: A | |
| example_title: MCQ Question Generation | |
| - inputs: | |
| instruction: >- | |
| Generate a multiple-choice question (MCQ) based on the passage, provide | |
| options, and indicate the correct option. | |
| context: >- | |
| Cellular respiration is a metabolic process that converts nutrients into | |
| ATP, the energy currency of the cell. | |
| outputs: | |
| question: What is the main purpose of cellular respiration? | |
| options: | |
| - A. Converting nutrients into ATP | |
| - B. Producing oxygen | |
| - C. Generating heat | |
| - D. Breaking down proteins | |
| correct_option: A | |
| example_title: Cellular Respiration MCQ | |
| - inputs: | |
| instruction: Generate a multiple-choice question (MCQ) based on a historical passage | |
| context: >- | |
| The Industrial Revolution began in Great Britain in the late 18th century, | |
| transforming manufacturing processes through mechanization. | |
| outputs: | |
| question: Where did the Industrial Revolution primarily originate? | |
| options: | |
| - A. United States | |
| - B. France | |
| - C. Great Britain | |
| - D. Germany | |
| correct_option: C | |
| example_title: Industrial Revolution MCQ | |
| - inputs: | |
| instruction: Generate a multiple-choice question about environmental science | |
| context: >- | |
| Biodiversity refers to the variety of life forms within a given ecosystem, | |
| including genetic, species, and ecological diversity. | |
| outputs: | |
| question: What does biodiversity encompass? | |
| options: | |
| - A. Only plant species | |
| - B. Genetic, species, and ecological diversity | |
| - C. Only animal populations | |
| - D. Human interactions with nature | |
| correct_option: B | |
| example_title: Biodiversity MCQ | |
| library_name: transformers | |
| # Uploaded model | |
| - **Developed by:** kanoza | |
| - **License:** apache-2.0 | |
| - **Finetuned from model :** unsloth/mistral-nemo-base-2407-bnb-4bit | |
| This mistral model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library. | |
| # Mistral Nemo MCQ Question Generator | |
| ## Overview | |
| A fine-tuned Mistral Nemo model specializing in generating multiple-choice questions (MCQs) across various domains. | |
| ## Model Details | |
| - **Base Model**: Mistral Nemo Base 2407 | |
| - **Fine-Tuning**: LoRA with 4-bit quantization | |
| - **Training Dataset**: SciQ | |
| - **Primary Task**: Automated MCQ Generation | |
| ## Key Features | |
| - Scientific domain question generation | |
| - Supports multiple context types | |
| - High-quality, contextually relevant options | |
| - Configurable question complexity | |
| ## Installation | |
| ```python | |
| pip install transformers unsloth | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| model = AutoModelForCausalLM.from_pretrained("path/to/model") | |
| tokenizer = AutoTokenizer.from_pretrained("path/to/model") | |
| ``` | |
| ## Usage Example | |
| ```python | |
| def generate_mcq(context, instruction): | |
| prompt = f""" | |
| Instruction: {instruction} | |
| Context: {context} | |
| """ | |
| inputs = tokenizer(prompt, return_tensors="pt") | |
| outputs = model.generate(**inputs, max_new_tokens=128) | |
| return tokenizer.decode(outputs[0]) | |
| # Example application | |
| context = "Photosynthesis converts sunlight into plant energy." | |
| mcq = generate_mcq(context, "Create a multiple-choice question") | |
| print(mcq) | |
| ``` | |
| ## Performance Metrics | |
| - BERTScore F1: [Placeholder] | |
| - ROUGE-1 F1: [Placeholder] | |
| - Generation Accuracy: [Placeholder] | |
| ## Limitations | |
| - Primarily trained on scientific content | |
| - Requires careful prompt engineering | |
| - Potential bias in question generation | |
| ## Ethical Considerations | |
| - Intended for educational research | |
| - Users should verify generated content | |
| ## License | |
| Apache 2.0 | |
| ## Contributing | |
| Contributions welcome! Please open issues/PRs on GitHub. | |
| [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth) |