Text Generation
Transformers
Safetensors
English
gemma
trl
sft
text-generation-inference
4-bit precision
bitsandbytes
Instructions to use PranavKeshav/reactgpt-1.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PranavKeshav/reactgpt-1.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PranavKeshav/reactgpt-1.1")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("PranavKeshav/reactgpt-1.1") model = AutoModelForCausalLM.from_pretrained("PranavKeshav/reactgpt-1.1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use PranavKeshav/reactgpt-1.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PranavKeshav/reactgpt-1.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PranavKeshav/reactgpt-1.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/PranavKeshav/reactgpt-1.1
- SGLang
How to use PranavKeshav/reactgpt-1.1 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 "PranavKeshav/reactgpt-1.1" \ --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": "PranavKeshav/reactgpt-1.1", "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 "PranavKeshav/reactgpt-1.1" \ --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": "PranavKeshav/reactgpt-1.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use PranavKeshav/reactgpt-1.1 with Docker Model Runner:
docker model run hf.co/PranavKeshav/reactgpt-1.1
Update README.md
Browse files
README.md
CHANGED
|
@@ -3,77 +3,71 @@ library_name: transformers
|
|
| 3 |
tags:
|
| 4 |
- trl
|
| 5 |
- sft
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
---
|
| 7 |
|
| 8 |
# Model Card for Model ID
|
| 9 |
|
| 10 |
-
|
| 11 |
-
|
| 12 |
|
| 13 |
|
| 14 |
## Model Details
|
| 15 |
|
| 16 |
### Model Description
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
| 21 |
|
| 22 |
-
- **Developed by:**
|
| 23 |
-
- **
|
| 24 |
-
- **
|
| 25 |
-
- **Model type:** [More Information Needed]
|
| 26 |
-
- **Language(s) (NLP):** [More Information Needed]
|
| 27 |
- **License:** [More Information Needed]
|
| 28 |
-
- **Finetuned from model
|
| 29 |
|
| 30 |
### Model Sources [optional]
|
| 31 |
|
| 32 |
-
<!-- Provide the basic links for the model. -->
|
| 33 |
-
|
| 34 |
- **Repository:** [More Information Needed]
|
| 35 |
- **Paper [optional]:** [More Information Needed]
|
| 36 |
- **Demo [optional]:** [More Information Needed]
|
| 37 |
|
| 38 |
## Uses
|
| 39 |
|
| 40 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
| 41 |
-
|
| 42 |
### Direct Use
|
| 43 |
|
| 44 |
-
|
| 45 |
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
### Downstream Use [optional]
|
| 49 |
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
[More Information Needed]
|
| 53 |
|
| 54 |
### Out-of-Scope Use
|
| 55 |
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
[More Information Needed]
|
| 59 |
|
| 60 |
## Bias, Risks, and Limitations
|
| 61 |
|
| 62 |
-
|
| 63 |
|
| 64 |
-
|
| 65 |
|
| 66 |
-
##
|
| 67 |
|
| 68 |
-
|
| 69 |
|
| 70 |
-
|
|
|
|
| 71 |
|
| 72 |
-
|
|
|
|
| 73 |
|
| 74 |
-
|
|
|
|
| 75 |
|
| 76 |
-
|
|
|
|
|
|
|
| 77 |
|
| 78 |
## Training Details
|
| 79 |
|
|
|
|
| 3 |
tags:
|
| 4 |
- trl
|
| 5 |
- sft
|
| 6 |
+
datasets:
|
| 7 |
+
- Hardik1234/reactjs_labelled
|
| 8 |
+
language:
|
| 9 |
+
- en
|
| 10 |
---
|
| 11 |
|
| 12 |
# Model Card for Model ID
|
| 13 |
|
| 14 |
+
This model generates React component code from natural language descriptions. It leverages the capabilities of the CodeGemma-2B model for text-to-code generation tasks.
|
|
|
|
| 15 |
|
| 16 |
|
| 17 |
## Model Details
|
| 18 |
|
| 19 |
### Model Description
|
| 20 |
|
| 21 |
+
This is a text-to-React component code generation model fine-tuned on the `Hardik1234/reactjs_labelled` dataset with CodeGemma-2B as the base model. It aims to assist developers by generating React component code from textual descriptions, streamlining the development process.
|
|
|
|
|
|
|
| 22 |
|
| 23 |
+
- **Developed by:** Pranav Keshav
|
| 24 |
+
- **Model type:** Text generation
|
| 25 |
+
- **Language(s) (NLP):** English
|
|
|
|
|
|
|
| 26 |
- **License:** [More Information Needed]
|
| 27 |
+
- **Finetuned from model :** google/codegemma-2b
|
| 28 |
|
| 29 |
### Model Sources [optional]
|
| 30 |
|
|
|
|
|
|
|
| 31 |
- **Repository:** [More Information Needed]
|
| 32 |
- **Paper [optional]:** [More Information Needed]
|
| 33 |
- **Demo [optional]:** [More Information Needed]
|
| 34 |
|
| 35 |
## Uses
|
| 36 |
|
|
|
|
|
|
|
| 37 |
### Direct Use
|
| 38 |
|
| 39 |
+
The model can be used to generate React component code from textual descriptions, such as "NavBar component," which can be integrated directly into React applications.
|
| 40 |
|
| 41 |
+
### Downstream Use
|
|
|
|
|
|
|
| 42 |
|
| 43 |
+
This model can be fine-tuned further for specific use cases or integrated into development tools and platforms to enhance developer productivity by automating code generation.
|
|
|
|
|
|
|
| 44 |
|
| 45 |
### Out-of-Scope Use
|
| 46 |
|
| 47 |
+
The model is not quite suitable for generating code for non-React frameworks or languages. It may also produce incorrect or non-functional code if the input description is unclear or ambiguous.
|
|
|
|
|
|
|
| 48 |
|
| 49 |
## Bias, Risks, and Limitations
|
| 50 |
|
| 51 |
+
### Recommendations
|
| 52 |
|
| 53 |
+
Users should be aware that the generated code may require manual verification and refinement. The model may also reflect biases present in the training data, and care should be taken to review and test the generated code thoroughly.
|
| 54 |
|
| 55 |
+
## How to Get Started with the Model
|
| 56 |
|
| 57 |
+
Use the code below to generate react component code from the model:
|
| 58 |
|
| 59 |
+
```python
|
| 60 |
+
from transformers import GemmaTokenizer, AutoModelForCausalLM
|
| 61 |
|
| 62 |
+
tokenizer = GemmaTokenizer.from_pretrained("PranavKeshav/reactgpt-1.2")
|
| 63 |
+
model = AutoModelForCausalLM.from_pretrained("PranavKeshav/reactgpt-1.2")
|
| 64 |
|
| 65 |
+
input_text = "PageNotFound component"
|
| 66 |
+
input_ids = tokenizer(input_text, return_tensors="pt")
|
| 67 |
|
| 68 |
+
outputs = model.generate(**input_ids)
|
| 69 |
+
print(tokenizer.decode(outputs[0]))
|
| 70 |
+
```
|
| 71 |
|
| 72 |
## Training Details
|
| 73 |
|