Instructions to use ilyasoulk/AigrisGPT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ilyasoulk/AigrisGPT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ilyasoulk/AigrisGPT")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ilyasoulk/AigrisGPT") model = AutoModelForCausalLM.from_pretrained("ilyasoulk/AigrisGPT") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use ilyasoulk/AigrisGPT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ilyasoulk/AigrisGPT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ilyasoulk/AigrisGPT", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ilyasoulk/AigrisGPT
- SGLang
How to use ilyasoulk/AigrisGPT 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 "ilyasoulk/AigrisGPT" \ --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": "ilyasoulk/AigrisGPT", "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 "ilyasoulk/AigrisGPT" \ --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": "ilyasoulk/AigrisGPT", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ilyasoulk/AigrisGPT with Docker Model Runner:
docker model run hf.co/ilyasoulk/AigrisGPT
Model Card for Model ID
Model Details
Model Description
This model is a specialized version of the GPT-2 architecture, fine-tuned for generating negative movie reviews. It aims to produce text reflecting strong dissatisfaction, capturing nuances in negative sentiment and expressing them effectively in generated content.
- Model type: GPT-2 fine-tuned for negative movie reviews
- Language(s) (NLP): English
Uses
from transformers import GPT2LMHeadModel, GPT2Tokenizer
# Specify the model path
model_path = "AigrisGPT"
# Load the model and tokenizer
model = GPT2LMHeadModel.from_pretrained(model_path)
tokenizer = GPT2Tokenizer.from_pretrained(model_path)
input_sequence = "This movie"
max_length = 100
# Encode the input text
input_ids = tokenizer.encode(input_sequence, return_tensors='pt')
# Generate text using the model
output_ids = model.generate(
input_ids,
max_length=max_length,
pad_token_id=model.config.eos_token_id,
top_k=50,
top_p=0.95,
do_sample=True
)
# Decode and print the generated text
generated_text = tokenizer.decode(output_ids[0], skip_special_tokens=True)
print(generated_text)
Example of Model Output
Here is an example of text generated by this model with an input This movie:
’This movie tries too hard to be a thriller film and to say there are lots of people like me who like this kind of movies it falls apart at some points. But the thing is this: these people would probably be bored with the genre anyway. All the characters are a mix of stereotypical, racist, violent and sexist stereotypes which are supposed to fit into a mmon genre. One that I found myself thinking about after I watched it. I should have read the books first. If not, I’
- Downloads last month
- 7