Text Generation
Transformers
English
qwen2
code-generation
python
fine-tuning
Qwen
tools
agent-framework
multi-agent
conversational
Eval Results (legacy)
Instructions to use my-ai-stack/Stack-2-9-finetuned with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use my-ai-stack/Stack-2-9-finetuned with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="my-ai-stack/Stack-2-9-finetuned") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("my-ai-stack/Stack-2-9-finetuned") model = AutoModelForCausalLM.from_pretrained("my-ai-stack/Stack-2-9-finetuned") 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 my-ai-stack/Stack-2-9-finetuned with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "my-ai-stack/Stack-2-9-finetuned" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "my-ai-stack/Stack-2-9-finetuned", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/my-ai-stack/Stack-2-9-finetuned
- SGLang
How to use my-ai-stack/Stack-2-9-finetuned 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 "my-ai-stack/Stack-2-9-finetuned" \ --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": "my-ai-stack/Stack-2-9-finetuned", "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 "my-ai-stack/Stack-2-9-finetuned" \ --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": "my-ai-stack/Stack-2-9-finetuned", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use my-ai-stack/Stack-2-9-finetuned with Docker Model Runner:
docker model run hf.co/my-ai-stack/Stack-2-9-finetuned
walidsobhie-code commited on
Commit ·
31f5bef
1
Parent(s): faeab43
fix: remove feedback prompt from chat mode for cleaner UX
Browse files- src/stack-2.9-cli.py +0 -20
src/stack-2.9-cli.py
CHANGED
|
@@ -176,26 +176,6 @@ class Stack29TUI:
|
|
| 176 |
# Add assistant response
|
| 177 |
messages.append(ChatMessage(role="assistant", content=result.text))
|
| 178 |
|
| 179 |
-
# Store feedback option
|
| 180 |
-
print("\n[Options: s=store success, f=store failure, c=continue] ", end="")
|
| 181 |
-
feedback = self.get_input()
|
| 182 |
-
if feedback.lower() == "s":
|
| 183 |
-
# Store as successful pattern
|
| 184 |
-
self.pattern_miner.store_feedback(
|
| 185 |
-
problem_type="chat",
|
| 186 |
-
solution=result.text,
|
| 187 |
-
success=True
|
| 188 |
-
)
|
| 189 |
-
print("✓ Stored as successful pattern")
|
| 190 |
-
elif feedback.lower() == "f":
|
| 191 |
-
self.pattern_miner.store_feedback(
|
| 192 |
-
problem_type="chat",
|
| 193 |
-
solution=user_input,
|
| 194 |
-
success=False,
|
| 195 |
-
error_message=result.text
|
| 196 |
-
)
|
| 197 |
-
print("✓ Stored as feedback for learning")
|
| 198 |
-
|
| 199 |
except Exception as e:
|
| 200 |
print(f"Error: {e}")
|
| 201 |
|
|
|
|
| 176 |
# Add assistant response
|
| 177 |
messages.append(ChatMessage(role="assistant", content=result.text))
|
| 178 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
except Exception as e:
|
| 180 |
print(f"Error: {e}")
|
| 181 |
|