Instructions to use DarkSting/Mcq_Generator_Updated with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use DarkSting/Mcq_Generator_Updated with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Math-1.5B-Instruct") model = PeftModel.from_pretrained(base_model, "DarkSting/Mcq_Generator_Updated") - Transformers
How to use DarkSting/Mcq_Generator_Updated with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="DarkSting/Mcq_Generator_Updated") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("DarkSting/Mcq_Generator_Updated", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use DarkSting/Mcq_Generator_Updated with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "DarkSting/Mcq_Generator_Updated" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DarkSting/Mcq_Generator_Updated", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/DarkSting/Mcq_Generator_Updated
- SGLang
How to use DarkSting/Mcq_Generator_Updated 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 "DarkSting/Mcq_Generator_Updated" \ --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": "DarkSting/Mcq_Generator_Updated", "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 "DarkSting/Mcq_Generator_Updated" \ --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": "DarkSting/Mcq_Generator_Updated", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use DarkSting/Mcq_Generator_Updated with Docker Model Runner:
docker model run hf.co/DarkSting/Mcq_Generator_Updated
Upload Untitled0.ipynb with huggingface_hub
Browse files- Untitled0.ipynb +1 -0
Untitled0.ipynb
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[],"authorship_tag":"ABX9TyOCbJlVIHdz9q4zD/sgBYR1"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[{"cell_type":"code","execution_count":1,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"3N_Y0TYBZPaT","executionInfo":{"status":"ok","timestamp":1767067036916,"user_tz":-330,"elapsed":7168,"user":{"displayName":"akeesh jaden","userId":"12491758087776865744"}},"outputId":"0f77501c-5bdb-4b82-abce-87dff2d7d1a9"},"outputs":[{"output_type":"stream","name":"stdout","text":["Requirement already satisfied: huggingface_hub in /usr/local/lib/python3.12/dist-packages (0.36.0)\n","Requirement already satisfied: filelock in /usr/local/lib/python3.12/dist-packages (from huggingface_hub) (3.20.0)\n","Requirement already satisfied: fsspec>=2023.5.0 in /usr/local/lib/python3.12/dist-packages (from huggingface_hub) (2025.3.0)\n","Requirement already satisfied: packaging>=20.9 in /usr/local/lib/python3.12/dist-packages (from huggingface_hub) (25.0)\n","Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.12/dist-packages (from huggingface_hub) (6.0.3)\n","Requirement already satisfied: requests in /usr/local/lib/python3.12/dist-packages (from huggingface_hub) (2.32.4)\n","Requirement already satisfied: tqdm>=4.42.1 in /usr/local/lib/python3.12/dist-packages (from huggingface_hub) (4.67.1)\n","Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.12/dist-packages (from huggingface_hub) (4.15.0)\n","Requirement already satisfied: hf-xet<2.0.0,>=1.1.3 in /usr/local/lib/python3.12/dist-packages (from huggingface_hub) (1.2.0)\n","Requirement already satisfied: charset_normalizer<4,>=2 in /usr/local/lib/python3.12/dist-packages (from requests->huggingface_hub) (3.4.4)\n","Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.12/dist-packages (from requests->huggingface_hub) (3.11)\n","Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.12/dist-packages (from requests->huggingface_hub) (2.5.0)\n","Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.12/dist-packages (from requests->huggingface_hub) (2025.11.12)\n"]}],"source":["!pip install huggingface_hub"]},{"cell_type":"code","source":["!huggingface-cli repo create teachers_guide_and_matching_score --type model"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"vB_RVfPuZSEO","executionInfo":{"status":"ok","timestamp":1767067149108,"user_tz":-330,"elapsed":1124,"user":{"displayName":"akeesh jaden","userId":"12491758087776865744"}},"outputId":"0a581c6f-86bf-4778-d209-34a6dff628a2"},"execution_count":3,"outputs":[{"output_type":"stream","name":"stdout","text":["\u001b[33mThe --type argument is deprecated and will be removed in a future version. Use --repo-type instead.\u001b[0m\n","\u001b[33m⚠️ Warning: 'huggingface-cli repo' is deprecated. Use 'hf repo' instead.\u001b[0m\n","Successfully created \u001b[1mChamith2000/teachers_guide_and_matching_score\u001b[0m on the Hub.\n","Your repo is now available at \u001b[1mhttps://huggingface.co/Chamith2000/teachers_guide_and_matching_score\u001b[0m\n"]}]},{"cell_type":"code","source":["from google.colab import drive\n","\n","drive.mount('/content/drive')"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"7ZitIQUAZUBY","executionInfo":{"status":"ok","timestamp":1767067169835,"user_tz":-330,"elapsed":17369,"user":{"displayName":"akeesh jaden","userId":"12491758087776865744"}},"outputId":"0e03f9a2-eadc-4a77-c5db-f26c01aadfbe"},"execution_count":4,"outputs":[{"output_type":"stream","name":"stdout","text":["Mounted at /content/drive\n"]}]},{"cell_type":"code","source":["from huggingface_hub import upload_file\n","\n","upload_file(\n"," path_or_fileobj=\"/content/drive/MyDrive/teachers_guide_and_question_answer_model/adapter_model.safetensors\",\n"," path_in_repo=\"adapter_model.safetensors\",\n"," repo_id=\"Chamith2000/qwen2.5-math-mcq-lora\",\n"," repo_type=\"model\"\n",")"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"ShpwqQz_ZjxL","outputId":"3c2293e6-73c0-4611-f03d-b9f0e9e0b154"},"execution_count":null,"outputs":[{"output_type":"stream","name":"stderr","text":["/usr/local/lib/python3.12/dist-packages/huggingface_hub/utils/_auth.py:94: UserWarning: \n","The secret `HF_TOKEN` does not exist in your Colab secrets.\n","To authenticate with the Hugging Face Hub, create a token in your settings tab (https://huggingface.co/settings/tokens), set it as secret in your Google Colab and restart your session.\n","You will be able to reuse this secret in all of your notebooks.\n","Please note that authentication is recommended but still optional to access public models or datasets.\n"," warnings.warn(\n"]}]},{"cell_type":"code","source":["from huggingface_hub import upload_folder\n","\n","upload_folder(\n"," folder_path=\"/content/drive/MyDrive/teachers_guide_and_question_answer_model\",\n"," repo_id=\"Chamith2000/qwen2.5-math-mcq-lora\",\n"," repo_type=\"model\",\n"," ignore_patterns=[\"*.safetensors\"]\n",")"],"metadata":{"id":"7Z_d6o7xZmNy"},"execution_count":null,"outputs":[]}]}
|