Team Ai
Modelpublic

foduucom/Think-and-Code-React

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
0likes31downloads
README.md124 linesDownload Raw Back to root
1---2license: apache-2.03language:4- en5library_name: transformers6tags:7- Reasoning8- React9- COT10- MachineLearning11- DeepLearning12- FineTuning13- NLP14- AIResearch15---16 17# Think-and-Code-React18This is a fine-tuned Qwen model which is designed to provide frontend development solutions with enhanced reasoning capabilities on ReactJS. It can writes code after reasoning task then provide some best prectice after ansering.19 20## Table of Contents211. [Problem Statement](#problem-statement)222. [Solution](#solution)233. [How It Works](#how-it-works)244. [How to Use This Model](#how-to-use-this-model)255. [Future Developments](#future-developments)266. [License](#license)277. [Model Card Contact](#model-card-contact)28 29## Problem Statement30 31Coading is a challenging task for small models. small models as not enough capable for writing code with heigh accuracy and reasoning whare React is widely used javascript liberary and most time we found that small LLM are not very specific to programming:32 33## Solution34 35Training LLM for React specific dataset and enable reasoning task. This LLM provides us cold start with React based LLM whare it does understand many react concept.:36 371. Understands user's query382. Evaluate Everything in \<think> tag393. Provide answer in \<answer>404. Additionally provide Best Prectices in \<verifier_answer>41 42 43## How It Works44 451. **Data Collection**: The model is trained on 1000's of react specific senerios. it does provide us cold start with good reasoning capabilities46 472. **Feature Extraction**: Upscalling it using RL to enable model with heigh level of accuracy and better output for reasoning.48 493. **Machine Learning**: A sophisticated machine learning algorithm is employed to learn the heigh quality code in React Specific code and can be expand to all freamwork.50 51## How to Use This Model52 53### Prerequisites54 55- Python 3.7 or higher56- Required libraries (install via pip):57  ```bash58  pip install torch transformers59  ```60 61### Installation62 631. Clone this repository:64   ```bash65   git clone https://huggingface.co/foduucom/Think-and-Code-React66   cd Think-and-Code-React67   ```68 69### Usage70 711. Import the necessary libraries:72 73```python74import torch75from transformers import AutoTokenizer, AutoModelForCausalLM76```77 782. Setting up models:79 80```python81model_path = "./Path-to-llm-folder"82 83tokenizer = AutoTokenizer.from_pretrained(model_path)84model = AutoModelForCausalLM.from_pretrained(model_path)85 86device = "cuda" if torch.cuda.is_available() else "cpu"87model.to(device)88```89 903. Setting up AI Response:91 92```python93def generate_text(prompt, max_length=2000):94    inputs = tokenizer(prompt, return_tensors="pt").to(device)  95    output = model.generate(96        **inputs, 97        do_sample=True, 98        temperature=0.799    )100    return tokenizer.decode(output[0], skip_special_tokens=True)101```1024. Using LLM:103 104```python105prompt = "Write a code in react for calling api to server at https://example.com/test"106generated_text = generate_text(prompt)107 108print(generated_text)109```110 111## Future Developments112This is a cold start LLM and can be enhance it's capabalities using RL so that this LLM perform more better. Currently we have found 113 114## Model Card Contact115 116For inquiries and contributions, please contact us at info@foduu.com.117 118```bibtex119@ModelCard{120    author       = {Nehul Agrawal, Priyal Mehta and Ayush Panday},121    title         = {Think and Code in React},122    year           = {2025}123}124```