ChristophSchuhmann/essays-with-instructions
Viewer • Updated • 2.06k • 383 • 16
How to use KnutJaegersberg/Mistral-7B-EssayWriter with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="KnutJaegersberg/Mistral-7B-EssayWriter") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("KnutJaegersberg/Mistral-7B-EssayWriter")
model = AutoModelForCausalLM.from_pretrained("KnutJaegersberg/Mistral-7B-EssayWriter")How to use KnutJaegersberg/Mistral-7B-EssayWriter with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "KnutJaegersberg/Mistral-7B-EssayWriter"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "KnutJaegersberg/Mistral-7B-EssayWriter",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/KnutJaegersberg/Mistral-7B-EssayWriter
How to use KnutJaegersberg/Mistral-7B-EssayWriter with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "KnutJaegersberg/Mistral-7B-EssayWriter" \
--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": "KnutJaegersberg/Mistral-7B-EssayWriter",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "KnutJaegersberg/Mistral-7B-EssayWriter" \
--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": "KnutJaegersberg/Mistral-7B-EssayWriter",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use KnutJaegersberg/Mistral-7B-EssayWriter with Docker Model Runner:
docker model run hf.co/KnutJaegersberg/Mistral-7B-EssayWriter
Prompt Example:
### Instruction:
Provide the inputted essay that when summarized resulted in the following summary : The organization's learning and development practices are poor as they involve manual orientation from experienced workers. New employees are not advised of their roles in the organization before assignment of tasks. The orientation process takes long due to lack of a well-coordinated orientation programs.
### Response: