Text Generation
Transformers
PyTorch
TensorBoard
Safetensors
English
opt
Generated from Trainer
text-generation-inference
Instructions to use sr5434/gptQuotes with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sr5434/gptQuotes with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sr5434/gptQuotes")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sr5434/gptQuotes") model = AutoModelForCausalLM.from_pretrained("sr5434/gptQuotes", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sr5434/gptQuotes with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sr5434/gptQuotes" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sr5434/gptQuotes", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/sr5434/gptQuotes
- SGLang
How to use sr5434/gptQuotes 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 "sr5434/gptQuotes" \ --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": "sr5434/gptQuotes", "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 "sr5434/gptQuotes" \ --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": "sr5434/gptQuotes", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use sr5434/gptQuotes with Docker Model Runner:
docker model run hf.co/sr5434/gptQuotes
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,10 +1,15 @@
|
|
| 1 |
---
|
| 2 |
-
license:
|
| 3 |
tags:
|
| 4 |
- generated_from_trainer
|
| 5 |
model-index:
|
| 6 |
- name: gptQuotes
|
| 7 |
results: []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
|
@@ -19,6 +24,15 @@ This model is a fine-tuned version of [facebook/opt-350m](https://huggingface.co
|
|
| 19 |
|
| 20 |
Generating quotes with AI
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
## Training procedure
|
| 24 |
|
|
@@ -39,4 +53,4 @@ The following hyperparameters were used during training:
|
|
| 39 |
|
| 40 |
- Transformers 4.25.1
|
| 41 |
- Pytorch 1.13.1+cu116
|
| 42 |
-
- Tokenizers 0.13.2
|
|
|
|
| 1 |
---
|
| 2 |
+
license: mit
|
| 3 |
tags:
|
| 4 |
- generated_from_trainer
|
| 5 |
model-index:
|
| 6 |
- name: gptQuotes
|
| 7 |
results: []
|
| 8 |
+
datasets:
|
| 9 |
+
- Abirate/english_quotes
|
| 10 |
+
language:
|
| 11 |
+
- en
|
| 12 |
+
pipeline_tag: text-generation
|
| 13 |
---
|
| 14 |
|
| 15 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
|
|
|
| 24 |
|
| 25 |
Generating quotes with AI
|
| 26 |
|
| 27 |
+
## Sample code
|
| 28 |
+
```
|
| 29 |
+
from transformers import pipeline
|
| 30 |
+
|
| 31 |
+
ai = pipeline('text-generation',model='sr5434/gptQuotes', tokenizer='facebook/opt-350m', device=-1)#,config={'max_length':45})
|
| 32 |
+
while True:
|
| 33 |
+
result = ai(input("Prompt>>>"))[0]['generated_text']
|
| 34 |
+
print(result)
|
| 35 |
+
```
|
| 36 |
|
| 37 |
## Training procedure
|
| 38 |
|
|
|
|
| 53 |
|
| 54 |
- Transformers 4.25.1
|
| 55 |
- Pytorch 1.13.1+cu116
|
| 56 |
+
- Tokenizers 0.13.2
|