Text Generation
Transformers
Diffusers
Safetensors
English
gpt_oss
phillnet-2
gpt-oss
multimodal
image-generation
video-generation
speech
audio
custom-code
conversational
custom_code
Instructions to use ayjays132/Phillnet-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ayjays132/Phillnet-2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ayjays132/Phillnet-2", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ayjays132/Phillnet-2", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("ayjays132/Phillnet-2", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use ayjays132/Phillnet-2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ayjays132/Phillnet-2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ayjays132/Phillnet-2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ayjays132/Phillnet-2
- SGLang
How to use ayjays132/Phillnet-2 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 "ayjays132/Phillnet-2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ayjays132/Phillnet-2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "ayjays132/Phillnet-2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ayjays132/Phillnet-2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ayjays132/Phillnet-2 with Docker Model Runner:
docker model run hf.co/ayjays132/Phillnet-2
File size: 5,415 Bytes
101858b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | """
Example usage of ConsciousnessSystem.
Demonstrates consciousness processing using Qwen.
"""
import torch
import logging
from ConsciousnessSystem import ConsciousnessSystem, ConsciousnessSystemConfig
logging.basicConfig(level=logging.INFO, format='%(levelname)s: %(message)s')
logger = logging.getLogger(__name__)
def example_basic_consciousness():
"""Basic consciousness processing example."""
print("=" * 80)
print("ConsciousnessSystem - Basic Consciousness Processing")
print("=" * 80)
# Create configuration
config = ConsciousnessSystemConfig(
use_fp16=True,
device='cuda' if torch.cuda.is_available() else 'cpu',
enable_memory_update=True,
enable_thought_analysis=True,
)
# Initialize system
print("\nInitializing ConsciousnessSystem...")
consciousness_system = ConsciousnessSystem(config)
print("ConsciousnessSystem initialized!")
print(f" Using Qwen model: {config.model_name}")
print(f" All consciousness processing uses Qwen!")
print(f" Zero extra parameters - all from Qwen!")
# Create sample hidden states
batch_size = 2
seq_len = 20
hidden_size = consciousness_system.qwen_processor.hidden_size
hidden_states = torch.randn(batch_size, seq_len, hidden_size).to(consciousness_system.device)
if config.use_fp16:
hidden_states = hidden_states.half()
# Process through consciousness system
print("\nProcessing consciousness...")
metrics = consciousness_system.forward(hidden_states)
print(f"\nConsciousness Metrics:")
print(f" Creativity: {metrics['creativity']:.4f}")
print(f" Coherence: {metrics['coherence']:.4f}")
if metrics['delta_creativity'] is not None:
print(f" Delta Creativity: {metrics['delta_creativity']:+.4f}")
if metrics['delta_coherence'] is not None:
print(f" Delta Coherence: {metrics['delta_coherence']:+.4f}")
print(f" Memory Updated: {metrics['memory_updated']}")
if 'memory_state' in metrics:
print(f" Memory Nodes: {metrics['memory_state']['total_nodes']}")
def example_thought_analysis():
"""Thought analysis example."""
print("\n" + "=" * 80)
print("ConsciousnessSystem - Thought Analysis")
print("=" * 80)
config = ConsciousnessSystemConfig(use_fp16=True, enable_thought_analysis=True)
consciousness_system = ConsciousnessSystem(config)
# Add thoughts
thoughts = [
"I need to solve this problem step by step",
"First, I should understand the requirements",
"Then, I can design a solution",
]
print("\nAdding thoughts...")
for thought in thoughts:
consciousness_system.add_thought(thought)
print(f" Added: {thought}")
# Process with thought history
hidden_states = torch.randn(1, 10, consciousness_system.qwen_processor.hidden_size).to(consciousness_system.device)
if config.use_fp16:
hidden_states = hidden_states.half()
print("\nProcessing with thought analysis...")
metrics = consciousness_system.forward(hidden_states, thought_history=thoughts)
print(f" Creativity: {metrics['creativity']:.4f}")
print(f" Coherence: {metrics['coherence']:.4f}")
if metrics['plan_embedding'] is not None:
print(f" Plan Embedding Shape: {metrics['plan_embedding'].shape}")
def example_memory_management():
"""Memory management example."""
print("\n" + "=" * 80)
print("ConsciousnessSystem - Memory Management")
print("=" * 80)
config = ConsciousnessSystemConfig(use_fp16=True, enable_memory_update=True)
consciousness_system = ConsciousnessSystem(config)
# Add memories
print("\nAdding memories...")
for i in range(5):
embedding = torch.randn(consciousness_system.qwen_processor.hidden_size).to(consciousness_system.device)
if config.use_fp16:
embedding = embedding.half()
node_id = consciousness_system.memory.add_memory(
embedding,
metadata={'index': i, 'content': f'Memory {i}'},
score=0.5 + i * 0.1,
)
print(f" Added memory node {node_id}")
# Analyze memory state
memory_state = consciousness_system.memory.analyze_memory_state()
print(f"\nMemory State:")
print(f" Total Nodes: {memory_state['total_nodes']}")
print(f" Average Score: {memory_state['avg_score']:.4f}")
print(f" Utilization: {memory_state['utilization']:.2%}")
# Prune memory
print("\nPruning memory...")
prune_result = consciousness_system.memory.prune_memory()
print(f" Pruned: {prune_result['pruned_count']} nodes")
print(f" Retained: {prune_result['retained_count']} nodes")
# Get consciousness state
state = consciousness_system.get_consciousness_state()
print(f"\nConsciousness State:")
print(f" Creativity: {state['creativity']}")
print(f" Coherence: {state['coherence']}")
print(f" Memory Nodes: {state['memory_state']['total_nodes']}")
if __name__ == "__main__":
example_basic_consciousness()
example_thought_analysis()
example_memory_management()
print("\nAll examples completed successfully!")
|