Text Generation
Transformers
PyTorch
JAX
TensorBoard
Safetensors
Swedish
gpt2
text-generation-inference
Instructions to use flax-community/swe-gpt-wiki with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use flax-community/swe-gpt-wiki with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="flax-community/swe-gpt-wiki")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("flax-community/swe-gpt-wiki") model = AutoModelForCausalLM.from_pretrained("flax-community/swe-gpt-wiki") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use flax-community/swe-gpt-wiki with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "flax-community/swe-gpt-wiki" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "flax-community/swe-gpt-wiki", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/flax-community/swe-gpt-wiki
- SGLang
How to use flax-community/swe-gpt-wiki 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 "flax-community/swe-gpt-wiki" \ --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": "flax-community/swe-gpt-wiki", "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 "flax-community/swe-gpt-wiki" \ --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": "flax-community/swe-gpt-wiki", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use flax-community/swe-gpt-wiki with Docker Model Runner:
docker model run hf.co/flax-community/swe-gpt-wiki
Commit ·
ea54aa8
1
Parent(s): 1c47fec
Updated generation script2
Browse files- evaluate.py +1 -1
evaluate.py
CHANGED
|
@@ -6,5 +6,5 @@ model = GPT2LMHeadModel.from_pretrained("flax-community/swe-gpt-wiki")
|
|
| 6 |
|
| 7 |
generator = pipeline('text-generation', model=model, tokenizer=tokenizer)
|
| 8 |
set_seed(42)
|
| 9 |
-
result = generator("
|
| 10 |
print(result)
|
|
|
|
| 6 |
|
| 7 |
generator = pipeline('text-generation', model=model, tokenizer=tokenizer)
|
| 8 |
set_seed(42)
|
| 9 |
+
result = generator("En dag för länge sedan så fanns det", max_length=150, num_return_sequences=5)
|
| 10 |
print(result)
|