Text Generation
Transformers
Safetensors
English
chatbot
instruction-tuning
distilgpt2
alpaca
fine-tuned
offline
flask
Instructions to use Jasleen05/my-local-chatbot with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Jasleen05/my-local-chatbot with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Jasleen05/my-local-chatbot")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Jasleen05/my-local-chatbot", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Jasleen05/my-local-chatbot with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Jasleen05/my-local-chatbot" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Jasleen05/my-local-chatbot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Jasleen05/my-local-chatbot
- SGLang
How to use Jasleen05/my-local-chatbot 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 "Jasleen05/my-local-chatbot" \ --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": "Jasleen05/my-local-chatbot", "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 "Jasleen05/my-local-chatbot" \ --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": "Jasleen05/my-local-chatbot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Jasleen05/my-local-chatbot with Docker Model Runner:
docker model run hf.co/Jasleen05/my-local-chatbot
Update templates folder
Browse files- templates/index.html +4 -2
templates/index.html
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
|
@@ -8,9 +9,10 @@
|
|
| 8 |
</head>
|
| 9 |
<body>
|
| 10 |
<div class="sidebar">
|
| 11 |
-
<h2>🕓 Chat
|
|
|
|
| 12 |
<ul id="history-list">
|
| 13 |
-
<!--
|
| 14 |
</ul>
|
| 15 |
</div>
|
| 16 |
|
|
|
|
| 1 |
+
<!-- 📄 File: templates/index.html -->
|
| 2 |
<!DOCTYPE html>
|
| 3 |
<html lang="en">
|
| 4 |
<head>
|
|
|
|
| 9 |
</head>
|
| 10 |
<body>
|
| 11 |
<div class="sidebar">
|
| 12 |
+
<h2>🕓 Chat Sessions</h2>
|
| 13 |
+
<button id="new-chat-btn">➕ New Chat</button>
|
| 14 |
<ul id="history-list">
|
| 15 |
+
<!-- Session list loaded from backend -->
|
| 16 |
</ul>
|
| 17 |
</div>
|
| 18 |
|