Text Generation
Transformers
Safetensors
English
qwen2
text-generation-inference
coder
trl
sft
conversational
Instructions to use prithivMLmods/Viper-OneCoder-UIGEN with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/Viper-OneCoder-UIGEN with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="prithivMLmods/Viper-OneCoder-UIGEN") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("prithivMLmods/Viper-OneCoder-UIGEN") model = AutoModelForCausalLM.from_pretrained("prithivMLmods/Viper-OneCoder-UIGEN") 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 prithivMLmods/Viper-OneCoder-UIGEN with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/Viper-OneCoder-UIGEN" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/Viper-OneCoder-UIGEN", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/prithivMLmods/Viper-OneCoder-UIGEN
- SGLang
How to use prithivMLmods/Viper-OneCoder-UIGEN 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 "prithivMLmods/Viper-OneCoder-UIGEN" \ --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": "prithivMLmods/Viper-OneCoder-UIGEN", "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 "prithivMLmods/Viper-OneCoder-UIGEN" \ --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": "prithivMLmods/Viper-OneCoder-UIGEN", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use prithivMLmods/Viper-OneCoder-UIGEN with Docker Model Runner:
docker model run hf.co/prithivMLmods/Viper-OneCoder-UIGEN
Update README.md
Browse files
README.md
CHANGED
|
@@ -17,4 +17,69 @@ datasets:
|
|
| 17 |
- smirki/UI_REASONING_v1.01
|
| 18 |
- smirki/Parkytest
|
| 19 |
---
|
| 20 |
-

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
- smirki/UI_REASONING_v1.01
|
| 18 |
- smirki/Parkytest
|
| 19 |
---
|
| 20 |
+

|
| 21 |
+
|
| 22 |
+
# **Viper-OneCoder-UIGEN**
|
| 23 |
+
|
| 24 |
+
Viper-OneCoder-UIGEN is based on the Qwen 2.5 14B modality architecture, designed to be the **best** for web development and structured coding logic. It has been fine-tuned on a synthetic dataset leveraging the latest coding logits and CoT datasets, further optimizing its **step-by-step logic breakdown** and **front-end problem-solving** abilities. The model demonstrates significant improvements in **context understanding, structured UI development, and long-context comprehension**, making it ideal for **web-based coding tasks, HTML/CSS/Tailwind development, and detailed instruction following**.
|
| 25 |
+
|
| 26 |
+
### **Key Improvements**
|
| 27 |
+
1. **Best-in-Class Web Development Proficiency**: Advanced understanding of **HTML, CSS, Tailwind, JavaScript**, and front-end frameworks.
|
| 28 |
+
2. **Fine-Tuned Step-by-Step Logic Breakdown**: Optimized for structured explanations, component-based UI coding, and logic-driven development.
|
| 29 |
+
3. **Advanced Instruction Following**: Delivers precise responses, structured outputs (e.g., JSON, YAML), and extended text generation (**8K+ tokens**).
|
| 30 |
+
4. **Long-Context Mastery**: Handles up to **128K tokens** with an output capability of **8K tokens** per response.
|
| 31 |
+
5. **Multilingual Code Support**: Excels in **HTML, CSS, JavaScript, React, Tailwind CSS, Python**, and other major web-related languages, with documentation in **29+ languages**.
|
| 32 |
+
|
| 33 |
+
### **Quickstart with Transformers**
|
| 34 |
+
|
| 35 |
+
```python
|
| 36 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 37 |
+
|
| 38 |
+
model_name = "prithivMLmods/Viper-OneCoder-UIGEN"
|
| 39 |
+
|
| 40 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 41 |
+
model_name,
|
| 42 |
+
torch_dtype="auto",
|
| 43 |
+
device_map="auto",
|
| 44 |
+
trust_remote_code=True
|
| 45 |
+
)
|
| 46 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 47 |
+
|
| 48 |
+
prompt = "Create a responsive navigation bar using Tailwind CSS."
|
| 49 |
+
messages = [
|
| 50 |
+
{"role": "system", "content": "You are an advanced AI assistant with expert-level UI coding and reasoning abilities."},
|
| 51 |
+
{"role": "user", "content": prompt}
|
| 52 |
+
]
|
| 53 |
+
text = tokenizer.apply_chat_template(
|
| 54 |
+
messages,
|
| 55 |
+
tokenize=False,
|
| 56 |
+
add_generation_prompt=True
|
| 57 |
+
)
|
| 58 |
+
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
| 59 |
+
|
| 60 |
+
generated_ids = model.generate(
|
| 61 |
+
**model_inputs,
|
| 62 |
+
max_new_tokens=512
|
| 63 |
+
)
|
| 64 |
+
generated_ids = [
|
| 65 |
+
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
| 66 |
+
]
|
| 67 |
+
|
| 68 |
+
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
| 69 |
+
print(response)
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
### **Intended Use**
|
| 73 |
+
- **Elite Web Development & UI Design**: Best-in-class model for writing, analyzing, and optimizing front-end code.
|
| 74 |
+
- **Step-by-Step Coding Logic Breakdown**: Guides developers through structured programming approaches and best practices.
|
| 75 |
+
- **Component-Based UI Development**: Generates reusable Tailwind and React components with clear explanations.
|
| 76 |
+
- **Structured Data Processing**: Handles JSON, XML, and structured UI component automation.
|
| 77 |
+
- **Multilingual Programming Support**: Proficient in HTML, CSS, Tailwind, JavaScript, React, Python, and Go.
|
| 78 |
+
- **Extended Technical Content Generation**: Ideal for writing documentation, blog posts, and front-end tutorials.
|
| 79 |
+
|
| 80 |
+
### **Limitations**
|
| 81 |
+
1. **High Computational Demand**: Requires powerful GPUs/TPUs for smooth inference due to **14B parameters**.
|
| 82 |
+
2. **Framework-Specific Variability**: Performance may vary across different front-end frameworks.
|
| 83 |
+
3. **Possible Error Propagation**: Extended text outputs might introduce logical inconsistencies.
|
| 84 |
+
4. **Limited Real-World Awareness**: The model does not have access to real-time internet updates.
|
| 85 |
+
5. **Prompt Sensitivity**: Performance depends on how well the prompt is structured.
|