Update README.md
Browse files
README.md
CHANGED
@@ -1,11 +1,23 @@
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
-
tags:
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
---
|
5 |
|
6 |
# Model Card for Model ID
|
7 |
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
|
11 |
|
@@ -13,187 +25,89 @@ tags: []
|
|
13 |
|
14 |
### Model Description
|
15 |
|
16 |
-
|
17 |
|
18 |
-
|
19 |
|
20 |
-
|
21 |
-
- **Funded by [optional]:** [More Information Needed]
|
22 |
-
- **Shared by [optional]:** [More Information Needed]
|
23 |
-
- **Model type:** [More Information Needed]
|
24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
25 |
-
- **License:** [More Information Needed]
|
26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
27 |
|
28 |
-
|
29 |
|
30 |
-
|
|
|
|
|
31 |
|
32 |
-
- **Repository:** [More Information Needed]
|
33 |
-
- **Paper [optional]:** [More Information Needed]
|
34 |
-
- **Demo [optional]:** [More Information Needed]
|
35 |
|
36 |
## Uses
|
37 |
|
38 |
-
|
39 |
|
40 |
-
|
41 |
|
42 |
-
|
43 |
|
44 |
-
|
45 |
|
46 |
-
###
|
47 |
|
48 |
-
|
49 |
|
50 |
-
[More Information Needed]
|
51 |
|
52 |
-
|
53 |
|
54 |
-
|
55 |
|
56 |
-
|
57 |
|
58 |
-
|
59 |
|
60 |
-
|
61 |
|
62 |
-
[More Information Needed]
|
63 |
|
64 |
### Recommendations
|
65 |
|
66 |
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
|
|
|
|
|
|
|
|
|
|
67 |
|
68 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
69 |
|
70 |
## How to Get Started with the Model
|
71 |
|
72 |
-
|
|
|
|
|
|
|
73 |
|
74 |
-
|
|
|
|
|
|
|
75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
## Training Details
|
77 |
|
78 |
### Training Data
|
79 |
|
80 |
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
81 |
|
82 |
-
|
83 |
|
84 |
### Training Procedure
|
85 |
|
86 |
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
|
|
87 |
|
88 |
-
#### Preprocessing [optional]
|
89 |
-
|
90 |
-
[More Information Needed]
|
91 |
-
|
92 |
-
|
93 |
-
#### Training Hyperparameters
|
94 |
-
|
95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
96 |
-
|
97 |
-
#### Speeds, Sizes, Times [optional]
|
98 |
|
99 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
100 |
-
|
101 |
-
[More Information Needed]
|
102 |
-
|
103 |
-
## Evaluation
|
104 |
-
|
105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
106 |
-
|
107 |
-
### Testing Data, Factors & Metrics
|
108 |
-
|
109 |
-
#### Testing Data
|
110 |
-
|
111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
112 |
-
|
113 |
-
[More Information Needed]
|
114 |
-
|
115 |
-
#### Factors
|
116 |
-
|
117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
118 |
-
|
119 |
-
[More Information Needed]
|
120 |
-
|
121 |
-
#### Metrics
|
122 |
-
|
123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
124 |
-
|
125 |
-
[More Information Needed]
|
126 |
-
|
127 |
-
### Results
|
128 |
-
|
129 |
-
[More Information Needed]
|
130 |
|
131 |
#### Summary
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
## Model Examination [optional]
|
136 |
-
|
137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
138 |
-
|
139 |
-
[More Information Needed]
|
140 |
-
|
141 |
-
## Environmental Impact
|
142 |
-
|
143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
144 |
-
|
145 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
146 |
-
|
147 |
-
- **Hardware Type:** [More Information Needed]
|
148 |
-
- **Hours used:** [More Information Needed]
|
149 |
-
- **Cloud Provider:** [More Information Needed]
|
150 |
-
- **Compute Region:** [More Information Needed]
|
151 |
-
- **Carbon Emitted:** [More Information Needed]
|
152 |
-
|
153 |
-
## Technical Specifications [optional]
|
154 |
-
|
155 |
-
### Model Architecture and Objective
|
156 |
-
|
157 |
-
[More Information Needed]
|
158 |
-
|
159 |
-
### Compute Infrastructure
|
160 |
-
|
161 |
-
[More Information Needed]
|
162 |
-
|
163 |
-
#### Hardware
|
164 |
-
|
165 |
-
[More Information Needed]
|
166 |
-
|
167 |
-
#### Software
|
168 |
-
|
169 |
-
[More Information Needed]
|
170 |
-
|
171 |
-
## Citation [optional]
|
172 |
-
|
173 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
174 |
-
|
175 |
-
**BibTeX:**
|
176 |
-
|
177 |
-
[More Information Needed]
|
178 |
-
|
179 |
-
**APA:**
|
180 |
-
|
181 |
-
[More Information Needed]
|
182 |
-
|
183 |
-
## Glossary [optional]
|
184 |
-
|
185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
186 |
-
|
187 |
-
[More Information Needed]
|
188 |
-
|
189 |
-
## More Information [optional]
|
190 |
-
|
191 |
-
[More Information Needed]
|
192 |
-
|
193 |
-
## Model Card Authors [optional]
|
194 |
-
|
195 |
-
[More Information Needed]
|
196 |
-
|
197 |
-
## Model Card Contact
|
198 |
-
|
199 |
-
[More Information Needed]
|
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
+
tags:
|
4 |
+
- SVG
|
5 |
+
- Text-to-SVG
|
6 |
+
language:
|
7 |
+
- en
|
8 |
+
base_model:
|
9 |
+
- meta-llama/Llama-3.1-8B-Instruct
|
10 |
---
|
11 |
|
12 |
# Model Card for Model ID
|
13 |
|
14 |
+
lama-3.1-8B-Instruct-text-to-svg, is a fine-tuned version of Llama 3.1 8B Instruct designed for text-to-SVG generation. It takes natural language descriptions of images or shapes (e.g., "Draw a simple star in SVG.") and generates corresponding SVG (Scalable Vector Graphics) code. This can be useful for:
|
15 |
+
|
16 |
+
- **Design Automation**: Quickly generating visual elements from text prompts.
|
17 |
+
|
18 |
+
- **Web Development**: Creating SVGs for UI components.
|
19 |
+
|
20 |
+
- **Creative Applications**: Supporting artists and designers with concept visualization.
|
21 |
|
22 |
|
23 |
|
|
|
25 |
|
26 |
### Model Description
|
27 |
|
28 |
+
Llama-3.1-8B-Instruct-text-to-svg is a fine-tuned variant of the Llama 3.1 8B Instruct model specifically adapted for converting natural language prompts into SVG (Scalable Vector Graphics) code. This model leverages the robust language understanding of its base and has been refined on a dataset containing paired examples of text descriptions and their corresponding SVG outputs. As a result, it can interpret user instructions—such as "draw a simple star"—and generate syntactically correct SVG code to render the described graphic.
|
29 |
|
30 |
+
The model is particularly useful for designers, web developers, and creative professionals who wish to streamline the process of graphic creation. By automating the conversion of textual ideas into vector graphics, it enables rapid prototyping and design iteration without requiring in-depth knowledge of SVG syntax. This integration of language understanding and graphic generation offers a novel approach to design automation, potentially reducing both development time and manual effort.
|
31 |
|
32 |
+
This model card has been automatically generated on the 🤗 Hub, and while certain details (e.g., development credits or specific training hyperparameters) may be refined over time, the core functionality of translating text to SVG remains a powerful tool for creative and technical applications.
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
+
- **Developed by:** TAZI Mohannad
|
35 |
|
36 |
+
- **Model type:** safetensors
|
37 |
+
- **Language(s) (NLP):** En
|
38 |
+
- **Finetuned from model [optional]:** Llama-3.1-8B-Instruct
|
39 |
|
|
|
|
|
|
|
40 |
|
41 |
## Uses
|
42 |
|
43 |
+
This model is intended to convert natural language descriptions into SVG code, making it easier to create vector graphics directly from text prompts. Its primary users include:
|
44 |
|
45 |
+
- Designers & Illustrators: Quickly prototype visual ideas or generate design assets.
|
46 |
|
47 |
+
- Web Developers: Automate the creation of SVG elements for web interfaces.
|
48 |
|
49 |
+
- Creative Professionals: Experiment with visual concepts without extensive knowledge of graphic coding.
|
50 |
|
51 |
+
### Direct Use
|
52 |
|
53 |
+
Users can directly input text prompts (e.g., "draw a simple star") to receive corresponding SVG code, which can then be further refined or integrated into larger design workflows. This enables rapid prototyping and lowers the barrier to generating scalable graphics.
|
54 |
|
|
|
55 |
|
56 |
+
## Bias, Risks, and Limitations
|
57 |
|
58 |
+
While the model provides a novel approach to text-to-SVG generation, there are some considerations to keep in mind:
|
59 |
|
60 |
+
- Technical Limitations: The generated SVG code might occasionally contain syntactic errors or produce designs that do not fully match the prompt. Manual review or post-processing may be necessary.
|
61 |
|
62 |
+
- Data Bias: As the model is trained on paired text and SVG data, its outputs may reflect any biases or limitations inherent in the training dataset.
|
63 |
|
64 |
+
- Use-Case Scope: The model is primarily designed for basic SVG generation and might not be suited for highly complex or customized graphic design tasks.
|
65 |
|
|
|
66 |
|
67 |
### Recommendations
|
68 |
|
69 |
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
70 |
+
Verification: Always review and test generated SVG code before using it in production environments.
|
71 |
+
|
72 |
+
Fine-Tuning: For specialized design needs, consider additional fine-tuning or post-processing.
|
73 |
+
|
74 |
+
Feedback Loop: Engage with users to gather feedback on any recurring issues or unexpected behaviors to further refine the model.
|
75 |
|
|
|
76 |
|
77 |
## How to Get Started with the Model
|
78 |
|
79 |
+
To quickly test the model, load it using the Hugging Face Transformers library:
|
80 |
+
|
81 |
+
```python
|
82 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
83 |
|
84 |
+
# Load model and tokenizer from the repository
|
85 |
+
model_name = "mohannad-tazi/Llama-3.1-8B-Instruct-text-to-svg"
|
86 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
87 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
88 |
|
89 |
+
# Generate SVG code from a text prompt
|
90 |
+
input_text = "draw a simple star in SVG"
|
91 |
+
inputs = tokenizer(input_text, return_tensors="pt")
|
92 |
+
outputs = model.generate(**inputs, max_length=200)
|
93 |
+
svg_code = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
94 |
+
|
95 |
+
print(svg_code)
|
96 |
+
```
|
97 |
## Training Details
|
98 |
|
99 |
### Training Data
|
100 |
|
101 |
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
102 |
|
103 |
+
The training data comprises paired examples of natural language descriptions and their corresponding SVG code. This dataset is designed to cover a variety of basic graphic elements and design instructions. Detailed documentation for the dataset is available in the associated Dataset Card.
|
104 |
|
105 |
### Training Procedure
|
106 |
|
107 |
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
108 |
+
The model was fine-tuned on this paired dataset to learn the mapping from text prompts to SVG syntax. The procedure involved optimizing the model with standard language modeling techniques, adapted to generate structured SVG code.
|
109 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
|
112 |
#### Summary
|
113 |
+
In summary, Llama-3.1-8B-Instruct-text-to-svg has been fine-tuned to convert textual design descriptions into SVG code. Its intended use is to simplify and automate the graphic design process by leveraging natural language instructions, while being mindful of its technical limitations and potential biases inherited from its training data.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|