Instructions to use abhidgp1978/abhi-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use abhidgp1978/abhi-model 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 abhidgp1978/abhi-model:Q4_K_M # Run inference directly in the terminal: llama cli -hf abhidgp1978/abhi-model:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf abhidgp1978/abhi-model:Q4_K_M # Run inference directly in the terminal: llama cli -hf abhidgp1978/abhi-model:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf abhidgp1978/abhi-model:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf abhidgp1978/abhi-model:Q4_K_M
Use Docker
docker model run hf.co/abhidgp1978/abhi-model:Q4_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use abhidgp1978/abhi-model with Ollama:
ollama run hf.co/abhidgp1978/abhi-model:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use abhidgp1978/abhi-model with Docker Model Runner:
docker model run hf.co/abhidgp1978/abhi-model:Q4_K_M
- Lemonade
How to use abhidgp1978/abhi-model with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull abhidgp1978/abhi-model:Q4_K_M
Run and chat with the model
lemonade run user.abhi-model-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Update summary_api.py
Browse files- summary_api.py +23 -12
summary_api.py
CHANGED
|
@@ -1,19 +1,30 @@
|
|
| 1 |
-
# summary_api.py
|
| 2 |
from fastapi import FastAPI, Request
|
| 3 |
from pydantic import BaseModel
|
| 4 |
-
from
|
| 5 |
-
import
|
| 6 |
|
| 7 |
app = FastAPI()
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
query = request.data[0]
|
| 15 |
-
|
| 16 |
-
# Dummy logic – replace with actual inference using Gemma
|
| 17 |
-
summary = f"📝 Summary: This is a placeholder summary for: {query}"
|
| 18 |
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from fastapi import FastAPI, Request
|
| 2 |
from pydantic import BaseModel
|
| 3 |
+
from llama_cpp import Llama
|
| 4 |
+
import uvicorn
|
| 5 |
|
| 6 |
app = FastAPI()
|
| 7 |
|
| 8 |
+
# ✅ Load model from mistral-local repo directly
|
| 9 |
+
llm = Llama.from_pretrained(
|
| 10 |
+
repo_id="abhidgp1978/mistral-local",
|
| 11 |
+
filename="gemma-2b-it.gguf",
|
| 12 |
+
local_dir=".", # Root directory
|
| 13 |
+
n_ctx=2048,
|
| 14 |
+
n_threads=4,
|
| 15 |
+
n_gpu_layers=0,
|
| 16 |
+
f16_kv=True,
|
| 17 |
+
use_mlock=False,
|
| 18 |
+
verbose=False
|
| 19 |
+
)
|
| 20 |
|
| 21 |
+
class SummaryRequest(BaseModel):
|
| 22 |
+
data: list[str]
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
+
@app.post("/generate_summary")
|
| 25 |
+
async def generate_summary(req: SummaryRequest):
|
| 26 |
+
prompt = req.data[0]
|
| 27 |
+
full_prompt = f"Write a concise 100-word medical summary:\n\n{prompt.strip()}"
|
| 28 |
+
response = llm(full_prompt, max_tokens=256, stop=["User:", "Assistant:"], echo=False)
|
| 29 |
+
output = response["choices"][0]["text"].strip()
|
| 30 |
+
return {"summary": output}
|