Instructions to use Continuous-Rivals-Discrete/langflow-owt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Continuous-Rivals-Discrete/langflow-owt with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Continuous-Rivals-Discrete/langflow-owt", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForMaskedLM model = AutoModelForMaskedLM.from_pretrained("Continuous-Rivals-Discrete/langflow-owt", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Continuous-Rivals-Discrete/langflow-owt with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Continuous-Rivals-Discrete/langflow-owt" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Continuous-Rivals-Discrete/langflow-owt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Continuous-Rivals-Discrete/langflow-owt
- SGLang
How to use Continuous-Rivals-Discrete/langflow-owt 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 "Continuous-Rivals-Discrete/langflow-owt" \ --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": "Continuous-Rivals-Discrete/langflow-owt", "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 "Continuous-Rivals-Discrete/langflow-owt" \ --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": "Continuous-Rivals-Discrete/langflow-owt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Continuous-Rivals-Discrete/langflow-owt with Docker Model Runner:
docker model run hf.co/Continuous-Rivals-Discrete/langflow-owt
Download inference.py from Continuous-Rivals-Discrete/langflow-owt: direct link, hf CLI and curl.
- Browser
- Download file 1.97 kB
-
https://huggingface.co/Continuous-Rivals-Discrete/langflow-owt/resolve/d4439947469a6847a51a367eaa0d4a00a4486929/inference.py
- Command line
-
hf download hf://Continuous-Rivals-Discrete/langflow-owt@d4439947469a6847a51a367eaa0d4a00a4486929/inference.py
-
curl -L -o inference.py https://huggingface.co/Continuous-Rivals-Discrete/langflow-owt/resolve/d4439947469a6847a51a367eaa0d4a00a4486929/inference.py
1.97 kB
| """Simple inference script to test the HuggingFace LangFlow model.""" | |
| import argparse | |
| import torch | |
| from transformers import AutoModelForMaskedLM, AutoTokenizer | |
| def main(): | |
| parser = argparse.ArgumentParser(description="Generate samples with LangFlow") | |
| parser.add_argument( | |
| "--model_path", type=str, default="hf_release/model_weights", | |
| help="Path to the HuggingFace model directory") | |
| parser.add_argument( | |
| "--num_samples", type=int, default=5, | |
| help="Number of samples to generate") | |
| parser.add_argument( | |
| "--num_steps", type=int, default=128, | |
| help="Number of denoising steps") | |
| parser.add_argument( | |
| "--seq_length", type=int, default=1024, | |
| help="Sequence length") | |
| parser.add_argument( | |
| "--seed", type=int, default=42, | |
| help="Random seed") | |
| args = parser.parse_args() | |
| # Set seed for reproducibility | |
| torch.manual_seed(args.seed) | |
| if torch.cuda.is_available(): | |
| torch.cuda.manual_seed_all(args.seed) | |
| device = torch.device("cuda" if torch.cuda.is_available() else "cpu") | |
| print(f"Using device: {device}") | |
| tokenizer = AutoTokenizer.from_pretrained("gpt2") | |
| model = AutoModelForMaskedLM.from_pretrained( | |
| args.model_path, | |
| trust_remote_code=True | |
| ) | |
| model = model.to(device) | |
| model.eval() | |
| print(f"\nGenerating {args.num_samples} samples with {args.num_steps} steps...") | |
| with torch.no_grad(): | |
| samples = model.generate_samples( | |
| num_samples=args.num_samples, | |
| seq_length=args.seq_length, | |
| num_steps=args.num_steps, | |
| device=device | |
| ) | |
| texts = tokenizer.batch_decode(samples, skip_special_tokens=True) | |
| for i, text in enumerate(texts): | |
| print(f"\n--- Sample {i+1} ---") | |
| # Print first 500 characters to keep output manageable | |
| print(text[:500] + ("..." if len(text) > 500 else "")) | |
| if __name__ == "__main__": | |
| main() | |